public void CanReduce() { ParameterExpression variable = Expression.Variable(typeof(int)); UnaryExpression op = Expression.PostDecrementAssign(variable); Assert.True(op.CanReduce); Assert.NotSame(op, op.ReduceAndCheck()); }
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()); }