public void PartialEvalEvalsVoid()
        {
            var c = new ClassWithVoid();
            Expression <Action> test = () => c.SetValue(12);
            var expr = test.Body;

            Assert.Equal(ExpressionType.Call, expr.NodeType);
            var evaled = ExpressionEx.PartialEval(expr);

            Assert.Equal(ExpressionType.Default, evaled.NodeType);
            Assert.Equal(12, c.Value);
        }
        public void PartialDontEvalsVoidThatThrows()
        {
            var c = new ClassWithVoid();
            Expression <Action> test = () => c.InvokeWith42(10);
            var expr = test.Body;

            Assert.Equal(ExpressionType.Call, expr.NodeType);
            var evaled = ExpressionEx.PartialEval(expr);

            Assert.Equal(ExpressionType.Call, evaled.NodeType);
            test = () => c.InvokeWith42(42);

            expr = test.Body;
            Assert.Equal(ExpressionType.Call, expr.NodeType);
            evaled = ExpressionEx.PartialEval(expr);
            Assert.Equal(ExpressionType.Default, evaled.NodeType);

            Assert.Equal(42, c.Value);
        }