Ejemplo n.º 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());
        }
Ejemplo n.º 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());
        }