예제 #1
0
        //  Bitwise operator test
        public void BitwiseOperatorTest()
        {
            _operators = new List <BinaryOperator>()
            {
                BinaryOperator.And,
                BinaryOperator.Or
            };

            _leafNode = new List <NodeExpressionPair>()
            {
                ExpressionLeafs.ConstIntValue,
                ExpressionLeafs.StaticIntField,
                ExpressionLeafs.StaticIntProperty,
                ExpressionLeafs.UnsupportedBinaryOperator
            };

            List <Variable> variables = new List <Variable>()
            {
                LeafHelper.GetVariable <int>()
            };

            int numberOfTests = 0;

            foreach (TestBinaryExpression binExpr in EnumerateTest <int>(0, 2))
            {
                numberOfTests++;
                //Log.Info(numberOfTests.ToString());

                ExpressionTestRuntime.ValidateExpressionXaml <int>(binExpr);
                if (binExpr.ExpectedConversionException == null)
                {
                    ExpressionTestRuntime.ValidateExecutionResult(binExpr, variables);
                }
            }
        }
예제 #2
0
        //  Add two strings
        public void AddTwoStrings()
        {
            Expression <Func <ActivityContext, string> > expression =
                (env) => DummyHelper.StaticStringField1 + DummyHelper.StaticStringField2 + DummyHelper.StaticStringField3;

            Activity <string> expectedActivity = new InvokeMethod <string>()
            {
                MethodName = "Concat",
                TargetType = typeof(string),
                Parameters =
                {
                    new InArgument <string>()
                    {
                        EvaluationOrder = 0,
                        Expression      = new InvokeMethod <string>()
                        {
                            MethodName = "Concat",
                            TargetType = typeof(string),
                            Parameters =
                            {
                                new InArgument <string>()
                                {
                                    EvaluationOrder = 0,
                                    Expression      = new FieldValue <DummyHelper, string>()
                                    {
                                        FieldName = "StaticStringField1"
                                    },
                                },
                                new InArgument <string>()
                                {
                                    EvaluationOrder = 1,
                                    Expression      = new FieldValue <DummyHelper, string>()
                                    {
                                        FieldName = "StaticStringField2"
                                    },
                                }
                            }
                        },
                    },
                    new InArgument <string>()
                    {
                        EvaluationOrder = 1,
                        Expression      = new FieldValue <DummyHelper, string>()
                        {
                            FieldName = "StaticStringField3"
                        },
                    }
                }
            };

            TestExpression expr = new TestExpression()
            {
                ResultType     = typeof(string),
                ExpectedNode   = expectedActivity,
                ExpressionTree = expression
            };

            ExpressionTestRuntime.ValidateExpressionXaml <string>(expr);
            ExpressionTestRuntime.ValidateExecutionResult(expr, null);
        }
예제 #3
0
        //  Logical operator test
        public void LogicalOperatorTest()
        {
            _operators = new List <BinaryOperator>()
            {
                BinaryOperator.And,
                BinaryOperator.OrElse,
                BinaryOperator.Or,
                BinaryOperator.AndAlso
            };

            _leafNode = new List <NodeExpressionPair>()
            {
                ExpressionLeafs.ConstBooleanTrue,
                ExpressionLeafs.ConstBooleanFalse,
                ExpressionLeafs.StaticBooleanField,
                ExpressionLeafs.StaticBooleanProperty,
            };

            List <Variable> variables = new List <Variable>()
            {
                LeafHelper.GetVariable <Boolean>()
            };

            int numberOfTests = 0;

            foreach (TestBinaryExpression binExpr in EnumerateTest <Boolean>(0, 2))
            {
                numberOfTests++;
                //Log.Info(numberOfTests.ToString());
                ExpressionTestRuntime.ValidateExpressionXaml <Boolean>(binExpr);
                ExpressionTestRuntime.ValidateExecutionResult(binExpr, variables);
            }
        }
예제 #4
0
        //  Indexer
        public void RValueIndexer()
        {
            Expression <Func <ActivityContext, string> > lambda = (env) => DummyHelper.StaticDictionary[1];

            Activity <string> expectedActivity = new InvokeMethod <string>()
            {
                MethodName = "get_Item",
                Parameters =
                {
                    new InArgument <int>(1)
                    {
                        EvaluationOrder = 1
                    }
                },
                TargetObject = new InArgument <Dictionary <int, string> >()
                {
                    EvaluationOrder = 0,
                    Expression      = new FieldValue <DummyHelper, Dictionary <int, string> >()
                    {
                        FieldName = "StaticDictionary"
                    }
                }
            };

            TestExpression expr = new TestExpression()
            {
                ResultType     = typeof(string),
                ExpectedNode   = expectedActivity,
                ExpressionTree = lambda
            };

            ExpressionTestRuntime.ValidateExpressionXaml <string>(expr);
            ExpressionTestRuntime.ValidateExecutionResult(expr, null);
        }
예제 #5
0
        public void NewWithArgument()
        {
            TestExpression expr = new TestExpression()
            {
                ResultType   = typeof(String),
                ExpectedNode = new New <String>()
                {
                    Arguments =
                    {
                        new InArgument <char>('a')
                        {
                            EvaluationOrder = 0
                        },
                        new InArgument <int>(1)
                        {
                            EvaluationOrder = 1,
                        },
                    }
                },
                ExpressionTree = Expression.New(
                    typeof(String).GetConstructor(new Type[] { typeof(char), typeof(int) }),
                    Expression.Constant('a'),
                    Expression.Constant(1))
            };

            ExpressionTestRuntime.ValidateExpressionXaml <String>(expr);
            ExpressionTestRuntime.ValidateExecutionResult(expr, null);
        }
예제 #6
0
        //  Test value type unary expression
        public void ValueTypeUnaryExpressionTest()
        {
            _operators = new List <UnaryOperator>()
            {
                UnaryOperator.Not,
                UnaryOperator.Cast,
                UnaryOperator.CheckedCast
            };

            _leafNode = new List <NodeExpressionPair>()
            {
                ExpressionLeafs.ConstIntValue,
                ExpressionLeafs.StaticIntField,
                ExpressionLeafs.StaticIntProperty,
            };

            List <Variable> variables = new List <Variable>()
            {
                LeafHelper.GetVariable <int>()
            };

            int numberOfTests = 0;

            foreach (TestUnaryExpression expr in EnumerateTest <int>(0, 2))
            {
                numberOfTests++;
                //Log.Info(numberOfTests.ToString());
                ExpressionTestRuntime.ValidateExpressionXaml <int>(expr);
                ExpressionTestRuntime.ValidateExecutionResult(expr, variables);
            }
        }
예제 #7
0
        //  Method call with argument
        public void MethodCallWithArgument()
        {
            NodeExpressionPair node = ExpressionLeafs.MethodCallNoParam;

            string         methodName = "MethodCallWithArgument";
            TestExpression expr       = new TestExpression()
            {
                ResultType   = typeof(int),
                ExpectedNode = new InvokeMethod <int>()
                {
                    MethodName = methodName,
                    TargetType = typeof(DummyHelper),
                    Parameters =
                    {
                        new InArgument <int>(
                            (InvokeMethod <int>)node.GetLeafNode())
                        {
                            EvaluationOrder = 1
                        }
                    }
                },
                ExpressionTree = Expression.Call(
                    typeof(DummyHelper).GetMethod(methodName, BindingFlags.Public | BindingFlags.Static),
                    node.LeafExpression)
            };

            ExpressionTestRuntime.ValidateExpressionXaml <int>(expr);
            ExpressionTestRuntime.ValidateExecutionResult(expr, null);
        }
예제 #8
0
        //  Test Cast TypeAs unary expression
        public void CastTypeAsTest()
        {
            _operators = new List <UnaryOperator>()
            {
                UnaryOperator.Cast,
                UnaryOperator.CheckedCast,
                UnaryOperator.TypeAs
            };

            _leafNode = new List <NodeExpressionPair>()
            {
                ExpressionLeafs.ConstStringValue,
                ExpressionLeafs.StaticStringField,
                ExpressionLeafs.StaticStringProperty,
            };

            Variable <String> stringVar = LeafHelper.GetVariable <string>();

            stringVar.Default = "String Variable";

            List <Variable> variables = new List <Variable>()
            {
                stringVar
            };

            int numberOfTests = 0;

            foreach (TestUnaryExpression expr in EnumerateTest <String>(0, 2))
            {
                numberOfTests++;
                //Log.Info(numberOfTests.ToString());
                ExpressionTestRuntime.ValidateExpressionXaml <string>(expr);
                ExpressionTestRuntime.ValidateExecutionResult(expr, variables);
            }
        }
예제 #9
0
        //  Method call with ref argument
        public void MethodCallWithRefArgument()
        {
            Expression <Func <ActivityContext, int> > expression = (env) => DummyHelper.MethodCallWithRefArgument(ref DummyHelper.StaticIntField);

            string         methodName = "MethodCallWithRefArgument";
            TestExpression expr       = new TestExpression()
            {
                ResultType   = typeof(int),
                ExpectedNode = new InvokeMethod <int>()
                {
                    MethodName = methodName,
                    TargetType = typeof(DummyHelper),
                    Parameters =
                    {
                        new InOutArgument <int>()
                        {
                            Expression = new FieldReference <DummyHelper, int>
                            {
                                FieldName = "StaticIntField"
                            },
                            EvaluationOrder = 1
                        }
                    }
                },
                ExpressionTree = expression
            };

            ExpressionTestRuntime.ValidateExpressionXaml <int>(expr);
            ExpressionTestRuntime.ValidateExecutionResult(expr, null);
        }
예제 #10
0
        //  Call generic method
        public void GenericMethodCall()
        {
            NodeExpressionPair node       = ExpressionLeafs.ConstStringValue;
            string             methodName = "GenericMethod";

            MethodInfo genericMethodHanlder            = typeof(DummyHelper).GetMethod(methodName, BindingFlags.Public | BindingFlags.Static);
            MethodInfo specializedGenericMethodHandler = genericMethodHanlder.MakeGenericMethod(typeof(string));

            TestExpression expr = new TestExpression()
            {
                ResultType   = typeof(string),
                ExpectedNode = new InvokeMethod <string>()
                {
                    MethodName           = methodName,
                    TargetType           = typeof(DummyHelper),
                    GenericTypeArguments =
                    {
                        typeof(string)
                    },
                    Parameters =
                    {
                        new InArgument <string>()
                        {
                            Expression      = (Activity <string>)node.GetLeafNode(),
                            EvaluationOrder = 1
                        }
                    }
                },
                ExpressionTree = Expression.Call(
                    specializedGenericMethodHandler, node.LeafExpression)
            };

            ExpressionTestRuntime.ValidateExpressionXaml <string>(expr);
            ExpressionTestRuntime.ValidateExecutionResult(expr, null);
        }
예제 #11
0
        public void NewArrayInit()
        {
            NotSupportedException expectedException = new NotSupportedException(
                string.Format(ErrorStrings.UnsupportedExpressionType, ExpressionType.NewArrayInit));

            Activity we = ExpressionTestRuntime.Convert((env) => new int[] { 1, 2, 3 }, expectedException);
        }
예제 #12
0
        //  Not operator with overloading
        public void NotOperatorWithOverloading()
        {
            Expression <Func <ActivityContext, DummyHelper> > expression = (env) => !DummyHelper.Instance;
            Activity <DummyHelper> expectedActivity = new InvokeMethod <DummyHelper>()
            {
                MethodName = "op_LogicalNot",
                TargetType = typeof(DummyHelper),
                Parameters =
                {
                    new InArgument <DummyHelper>(
                        new FieldValue <DummyHelper, DummyHelper>()
                    {
                        FieldName = "Instance"
                    })
                }
            };

            TestExpression expr = new TestExpression()
            {
                ResultType     = typeof(DummyHelper),
                ExpectedNode   = expectedActivity,
                ExpressionTree = expression
            };

            ExpressionTestRuntime.ValidateExpressionXaml <DummyHelper>(expr);
            ExpressionTestRuntime.ValidateExecutionResult(expr, null, typeof(DummyHelper));
        }
예제 #13
0
        //  None generic variable get
        public void NoneGenericVariableGet()
        {
            Variable <int> var = new Variable <int>()
            {
                Name = "NoneGenericVariable"
            };

            Activity <int> expectedActivity = new Cast <object, int>()
            {
                Operand = var,
                Checked = false
            };

            Expression <Func <ActivityContext, int> > lambda = (env) => (int)DummyHelper.NoneGenericVariable.Get(env);

            TestExpression expr = new TestExpression()
            {
                ResultType     = typeof(int),
                ExpectedNode   = expectedActivity,
                ExpressionTree = lambda
            };

            List <Variable> varsActual = new List <Variable>()
            {
                DummyHelper.NoneGenericVariable
            };

            List <Variable> varsExpected = new List <Variable>()
            {
                var
            };

            ExpressionTestRuntime.ValidateExpressionXaml <int>(expr);
            ExpressionTestRuntime.ValidateExecutionResult(expr, varsExpected, varsActual);
        }
예제 #14
0
        public void ConvertReferenceNull()
        {
            ArgumentNullException expectedException = new ArgumentNullException("expression", ErrorStrings.ExpressionRequiredForConversion);

            Expression <Func <ActivityContext, int> > expression = null;

            ExpressionTestRuntime.ConvertReference(expression, expectedException);
        }
예제 #15
0
        public void NewWithInitializer()
        {
            NotSupportedException expectedException = new NotSupportedException(
                string.Format(ErrorStrings.UnsupportedExpressionType, ExpressionType.MemberInit));

            ExpressionTestRuntime.Convert((env) => new DummyHelper()
            {
                StringVar = null
            }, expectedException);
        }
예제 #16
0
        //  Unsupported binary operator
        public void UnsupportedBinaryOperator()
        {
            NodeExpressionPair node = ExpressionLeafs.UnsupportedBinaryOperator;
            Expression <Func <ActivityContext, int> > lambdaExpression = Expression.Lambda <Func <ActivityContext, int> >((Expression)node.LeafExpression, Expression.Parameter(typeof(ActivityContext), "context"));

            NotSupportedException expectedException = new NotSupportedException(
                string.Format(ErrorStrings.UnsupportedExpressionType, ExpressionType.Coalesce));

            ExpressionTestRuntime.Convert(lambdaExpression, expectedException);
        }
예제 #17
0
        // Unsupported unary operator
        public void UnsupportedUnaryOperator()
        {
            NotSupportedException expectedException = new NotSupportedException(
                string.Format(ErrorStrings.UnsupportedExpressionType, ExpressionType.NegateChecked));

            Expression <Func <ActivityContext, int> > expression =
                Expression.Lambda <Func <ActivityContext, int> >(
                    Expression.MakeUnary(ExpressionType.NegateChecked, Expression.Constant(100), typeof(int)),
                    Expression.Parameter(typeof(ActivityContext), "context"));

            ExpressionTestRuntime.Convert(expression, expectedException);
        }
예제 #18
0
        public void NewWithoutArgument()
        {
            TestExpression expr = new TestExpression()
            {
                ResultType     = typeof(int),
                ExpectedNode   = new New <int>(),
                ExpressionTree = Expression.New(typeof(int))
            };

            ExpressionTestRuntime.ValidateExpressionXaml <int>(expr);
            ExpressionTestRuntime.ValidateExecutionResult(expr, null);
        }
예제 #19
0
        //  Static property
        public void StaticProperty()
        {
            NodeExpressionPair node = ExpressionLeafs.StaticIntProperty;
            TestExpression     expr = new TestExpression()
            {
                ResultType     = typeof(int),
                ExpectedNode   = node.GetLeafNode(),
                ExpressionTree = node.LeafExpression
            };

            ExpressionTestRuntime.ValidateExpressionXaml <int>(expr);
            ExpressionTestRuntime.ValidateExecutionResult(expr, null);
        }
예제 #20
0
        //  Constant value
        public void ConstantValue()
        {
            NodeExpressionPair node = ExpressionLeafs.ConstIntValue;
            TestExpression     expr = new TestExpression()
            {
                ResultType     = typeof(int),
                ExpectedNode   = node.GetLeafNode(),
                ExpressionTree = node.LeafExpression
            };

            ExpressionTestRuntime.ValidateExpressionXaml <int>(expr);
            ExpressionTestRuntime.ValidateExecutionResult(expr, null);
        }
예제 #21
0
        //  Add with generic type as operands
        public void AddGenericTypes()
        {
            Add <Nullable <int>, Nullable <int>, Nullable <int> > expectedActivity = new Add <Nullable <int>, Nullable <int>, Nullable <int> >()
            {
                Left = new InArgument <int?>()
                {
                    EvaluationOrder = 0,
                    Expression      = new New <Nullable <int> >()
                    {
                        Arguments =
                        {
                            new InArgument <int>(10)
                            {
                                EvaluationOrder = 0
                            }
                        }
                    },
                },
                Right = new InArgument <int?>()
                {
                    EvaluationOrder = 1,
                    Expression      = new New <Nullable <int> >()
                    {
                        Arguments =
                        {
                            new InArgument <int>(20)
                            {
                                EvaluationOrder = 0
                            }
                        }
                    }
                },
                Checked = false
            };

            ConstructorInfo ctorHandler = typeof(Nullable <int>).GetConstructors()[0];

            Expression expectedExpression = Expression.Add(
                Expression.New(ctorHandler, Expression.Constant(10)),
                Expression.New(ctorHandler, Expression.Constant(20)));

            TestExpression expr = new TestExpression()
            {
                ResultType     = typeof(Nullable <int>),
                ExpectedNode   = expectedActivity,
                ExpressionTree = expectedExpression
            };

            ExpressionTestRuntime.ValidateExpressionXaml <Nullable <int> >(expr);
            ExpressionTestRuntime.ValidateExecutionResult(expr, null);
        }
예제 #22
0
        //  Method call without argument
        public void MethodCallWithoutArgument()
        {
            NodeExpressionPair node = ExpressionLeafs.MethodCallNoParam;

            TestExpression expr = new TestExpression()
            {
                ResultType     = typeof(int),
                ExpectedNode   = node.GetLeafNode(),
                ExpressionTree = node.LeafExpression
            };

            ExpressionTestRuntime.ValidateExpressionXaml <int>(expr);
            ExpressionTestRuntime.ValidateExecutionResult(expr, null);
        }
예제 #23
0
        //  Workflow variable by Linq
        public void VariableByLinq()
        {
            // Linq treats local variable with special syntax.
            // See comment in LeafHelper.GetMemberAccessVariableExpression for more info.
            // The purpose test is to use real compiler generated lambda expression.
            Variable <string> var = new Variable <string>()
            {
                Name    = "var",
                Default = "Linq var test"
            };

            Expression <Func <ActivityContext, string> > expression = (env) => var.Get(env);

            CoreWf.Statements.Sequence expectedSequence = new CoreWf.Statements.Sequence()
            {
                Variables =
                {
                    var
                },
                Activities =
                {
                    new WriteLine()
                    {
                        Text = var
                    }
                }
            };

            CoreWf.Statements.Sequence actualSequence = new CoreWf.Statements.Sequence()
            {
                Variables =
                {
                    var
                },
                Activities =
                {
                    new WriteLine()
                    {
                        Text = ExpressionServices.Convert(expression)
                    }
                }
            };

            ExpressionTestRuntime.ValidateActivity(expectedSequence, actualSequence);
        }
예제 #24
0
        public static Activity ConvertReferenceAndValidate <TResult>(Expression <Func <ActivityContext, TResult> > expr, Activity expectedActivity, Exception expectedException)
        {
            bool     expectSuccess = expectedException == null ? true : false;
            Activity act           = ExpressionTestRuntime.ConvertReference(expr, expectedException);

            if (expectSuccess)
            {
                ExpressionTestRuntime.ValidateActivity(act, expectedActivity);
            }

            act = ExpressionTestRuntime.TryConvertReference(expr, expectSuccess);
            if (expectSuccess)
            {
                ExpressionTestRuntime.ValidateActivity(act, expectedActivity);
            }

            return(act);
        }
예제 #25
0
        //  Add different types that has operator overloading
        public void AddDifferentTypes()
        {
            Expression <Func <ActivityContext, DateTime> > expression =
                (env) => DummyHelper.StaticDate + DummyHelper.StaticTimeSpan;

            Activity <DateTime> expectedActivity = new InvokeMethod <DateTime>()
            {
                MethodName = "op_Addition",
                TargetType = typeof(DateTime),
                Parameters =
                {
                    new InArgument <DateTime>()
                    {
                        EvaluationOrder = 0,
                        Expression      = new FieldValue <DummyHelper, DateTime>()
                        {
                            FieldName = "StaticDate",
                        }
                    },
                    new InArgument <TimeSpan>()
                    {
                        EvaluationOrder = 1,
                        Expression      = new FieldValue <DummyHelper, TimeSpan>()
                        {
                            FieldName = "StaticTimeSpan",
                        }
                    },
                }
            };

            TestExpression expr = new TestExpression()
            {
                ResultType     = typeof(DateTime),
                ExpectedNode   = expectedActivity,
                ExpressionTree = expression
            };

            ExpressionTestRuntime.ValidateExpressionXaml <DateTime>(expr);
            ExpressionTestRuntime.ValidateExecutionResult(expr, null);
        }
예제 #26
0
        public void NewArray()
        {
            TestExpression expr = new TestExpression()
            {
                ResultType   = typeof(int[]),
                ExpectedNode = new NewArray <int[]>()
                {
                    Bounds =
                    {
                        new InArgument <int>(10)
                        {
                            EvaluationOrder = 0
                        }
                    }
                },
                ExpressionTree = Expression.NewArrayBounds(
                    typeof(int), Expression.Constant(10))
            };

            ExpressionTestRuntime.ValidateExpressionXaml <int[]>(expr);
            ExpressionTestRuntime.ValidateExecutionResult(expr, null);
        }
예제 #27
0
        //  Static delegate call
        public void StaticDelegateCall()
        {
            NodeExpressionPair node = ExpressionLeafs.MethodCallNoParam;

            string         delegateName = "StaticDelegate";
            TestExpression expr         = new TestExpression()
            {
                ResultType   = typeof(int),
                ExpectedNode = new InvokeMethod <int>()
                {
                    MethodName = "Invoke",
                    Parameters =
                    {
                        new InArgument <int>()
                        {
                            Expression      = (Activity <int>)node.GetLeafNode(),
                            EvaluationOrder = 1,
                        }
                    },
                    TargetObject = new InArgument <Func <int, int> >()
                    {
                        Expression = new FieldValue <DummyHelper, Func <int, int> >()
                        {
                            FieldName = delegateName,
                            Operand   = null,
                        },
                        EvaluationOrder = 0
                    }
                },
                ExpressionTree = Expression.Invoke(
                    Expression.Field(
                        null, typeof(DummyHelper).GetField(delegateName, BindingFlags.Public | BindingFlags.Static)),
                    node.LeafExpression)
            };

            ExpressionTestRuntime.ValidateExpressionXaml <int>(expr);
            ExpressionTestRuntime.ValidateExecutionResult(expr, null);
        }
예제 #28
0
        //  Convert cast expression
        public void ConvertCast()
        {
            NodeExpressionPair node = ExpressionLeafs.StaticIntField;

            Expression linq = Expression.Convert(node.LeafExpression, typeof(double));

            Activity <double> expectedActivity = new Cast <int, double>()
            {
                Checked = false,
                Operand = new InArgument <int>(
                    (Activity <int>)node.GetLeafNode())
            };

            TestExpression expr = new TestExpression()
            {
                ResultType     = typeof(double),
                ExpectedNode   = expectedActivity,
                ExpressionTree = linq
            };

            ExpressionTestRuntime.ValidateExpressionXaml <double>(expr);
            ExpressionTestRuntime.ValidateExecutionResult(expr, null);
        }
예제 #29
0
 //  Method call with VarArg
 public void TryMethodCallWithVarArg()
 {
     ExpressionTestRuntime.TryConvert((env) => DummyHelper.MethodCallWithVarArg(1, 2, 3), false);
 }
예제 #30
0
        //  Method call with different expressions as argument
        public void MethodCallWithVariousParameters()
        {
            Activity <int> expectedActivity = new InvokeMethod <int>()
            {
                MethodName = "MethodCallWithVariousArgs",
                TargetType = typeof(DummyHelper),
                Parameters =
                {
                    new InArgument <int>(-1)
                    {
                        EvaluationOrder = 1
                    },
                    new InArgument <string>("hello")
                    {
                        EvaluationOrder = 2,
                    },
                    new InOutArgument <int>()
                    {
                        EvaluationOrder = 3,
                        Expression      = new FieldReference <DummyHelper, int>()
                        {
                            FieldName = "StaticIntField"
                        },
                    },
                    new InArgument <Variable <int?> >()
                    {
                        EvaluationOrder = 4,
                        Expression      = new FieldValue <DummyHelper, Variable <int?> >()
                        {
                            FieldName = "StaticNullableIntVar"
                        }
                    },
                    new InArgument <Func <int, int> >()
                    {
                        EvaluationOrder = 5,
                        Expression      = new FieldValue <DummyHelper, Func <int, int> >()
                        {
                            FieldName = "StaticDelegate"
                        }
                    },
                    new InArgument <DummyHelper>()
                    {
                        EvaluationOrder = 6,
                        Expression      = new New <DummyHelper>()
                    }
                },
            };

            Expression <Func <ActivityContext, int> > expectedExpression =
                (env) => DummyHelper.MethodCallWithVariousArgs(-1, "hello", ref DummyHelper.StaticIntField, DummyHelper.StaticNullableIntVar, DummyHelper.StaticDelegate, new DummyHelper());

            TestExpression expr = new TestExpression()
            {
                ResultType     = typeof(int),
                ExpectedNode   = expectedActivity,
                ExpressionTree = expectedExpression
            };

            ExpressionTestRuntime.ValidateExpressionXaml <int>(expr);
            ExpressionTestRuntime.ValidateExecutionResult(expr, null);
        }