System.Dynamic.Tests.BindingRestrictionsProxyTests.CustomRestriction C# (CSharp) Method

CustomRestriction() private method

private CustomRestriction ( ) : void
return void
        public void CustomRestriction()
        {
            ConstantExpression exp = Expression.Constant(false);
            BindingRestrictions custom = BindingRestrictions.GetExpressionRestriction(exp);
            BindingRestrictionsProxyProxy view = GetDebugViewObject(custom);
            Assert.False(view.IsEmpty);
            BindingRestrictions[] restrictions = view.Restrictions;
            Assert.Equal(1, restrictions.Length);
            Assert.Same(custom, restrictions[0]);
            Assert.NotSame(BindingRestrictions.Empty.ToExpression(), view.Test);
            Assert.Same(exp, view.Test);
            Assert.Equal(exp.ToString(), view.ToString());
        }