Beispiel #1
0
        public void CanReduce()
        {
            ParameterExpression variable = Expression.Variable(typeof(int));
            UnaryExpression     op       = Expression.PostDecrementAssign(variable);

            Assert.True(op.CanReduce);
            Assert.NotSame(op, op.ReduceAndCheck());
        }
Beispiel #2
0
        public void CannotReduceThrow()
        {
            UnaryExpression throwExp = Expression.Throw(Expression.Constant(new TestException()));

            Assert.False(throwExp.CanReduce);
            Assert.Same(throwExp, throwExp.Reduce());
            Assert.Throws <ArgumentException>(() => throwExp.ReduceAndCheck());
        }