예제 #1
0
        public void TryNotEqualsOnIncompatibleTypes()
        {
            TestNotEqual <int, string, int> notEq = new TestNotEqual <int, string, int> {
                Right = "3"
            };

            TestRuntime.ValidateInstantiationException(notEq, TestExpressionTracer.GetExceptionMessage <int, string, int>(System.Linq.Expressions.ExpressionType.NotEqual));
        }
예제 #2
0
파일: Or.cs 프로젝트: sunxiaotianmg/CoreWF
        public void TryOROnIncompatibleTypes()
        {
            TestOr <int, string, int> intOr = new TestOr <int, string, int> {
                Right = "3"
            };

            TestRuntime.ValidateInstantiationException(intOr, TestExpressionTracer.GetExceptionMessage <int, string, int>(System.Linq.Expressions.ExpressionType.Or));
        }
예제 #3
0
        public void AddTwoIncompatibleTypes()
        {
            TestAdd <int, string, string> add = new TestAdd <int, string, string>
            {
                Left  = 12,
                Right = "12"
            };

            TestRuntime.ValidateInstantiationException(add, TestExpressionTracer.GetExceptionMessage <int, string, string>(exp.ExpressionType.Add));
        }
예제 #4
0
        public void MultiplyTwoIncompatibleTypes()
        {
            TestMultiply <int, string, string> multiply = new TestMultiply <int, string, string>
            {
                Left  = 12,
                Right = "12"
            };

            TestRuntime.ValidateInstantiationException(multiply, TestExpressionTracer.GetExceptionMessage <int, string, string>(exp.ExpressionType.Multiply));
        }
예제 #5
0
        public void ConstraintViolationIncompatibleTypes()
        {
            TestMultiply <int, string, string> mul = new TestMultiply <int, string, string>();

            string errorMessage = TestExpressionTracer.GetExceptionMessage <int, string, string>(System.Linq.Expressions.ExpressionType.Multiply);

            TestExpressionTracer.Validate(mul, new List <string> {
                errorMessage
            });
        }
예제 #6
0
        public void ConstraintViolatonInvalidExpression()
        {
            TestNot <string, Complex> not = new TestNot <string, Complex>();

            string errorMessage = TestExpressionTracer.GetExceptionMessage <string, Complex>(System.Linq.Expressions.ExpressionType.Not);

            TestExpressionTracer.Validate(not, new List <string> {
                errorMessage
            });
        }
예제 #7
0
파일: Or.cs 프로젝트: sunxiaotianmg/CoreWF
        public void ConstraintViolatonInvalidExpression()
        {
            TestOr <int, string, string> or = new TestOr <int, string, string>();

            string errorMessage = TestExpressionTracer.GetExceptionMessage <int, string, string>(System.Linq.Expressions.ExpressionType.Or);

            TestExpressionTracer.Validate(or, new List <string> {
                errorMessage
            });
        }
예제 #8
0
        public void ConstraintViolatonInvalidExpression()
        {
            TestNotEqual <int, string, string> notEq = new TestNotEqual <int, string, string>();

            string errorMessage = TestExpressionTracer.GetExceptionMessage <int, string, string>(System.Linq.Expressions.ExpressionType.NotEqual);

            TestExpressionTracer.Validate(notEq, new List <string> {
                errorMessage
            });
        }
예제 #9
0
        public void ConstraintViolationIncompatibleTypes()
        {
            TestAnd <int, string, string> and = new TestAnd <int, string, string>();

            string errorMessage = TestExpressionTracer.GetExceptionMessage <int, string, string>(System.Linq.Expressions.ExpressionType.And);

            TestExpressionTracer.Validate(and, new List <string> {
                errorMessage
            });
        }
예제 #10
0
        public void TryEqualsOnIncompatibleTypes()
        {
            TestEqual <int, string, string> eq = new TestEqual <int, string, string>
            {
                Left  = 12,
                Right = "12"
            };

            TestRuntime.ValidateInstantiationException(eq, TestExpressionTracer.GetExceptionMessage <int, string, string>(System.Linq.Expressions.ExpressionType.Equal));
        }
예제 #11
0
        public void TryANDOnIncompatibleTypes()
        {
            TestAnd <bool, string, bool> and = new TestAnd <bool, string, bool>
            {
                Left  = true,
                Right = "true"
            };

            TestRuntime.ValidateInstantiationException(and, TestExpressionTracer.GetExceptionMessage <bool, string, bool>(exp.ExpressionType.And));
        }
예제 #12
0
파일: Subtract.cs 프로젝트: jbzorg/corewf
        public void SubtractTwoIncompatibleTypes()
        {
            TestSubtract <int, string, string> sub = new TestSubtract <int, string, string>
            {
                Left  = 12,
                Right = "12"
            };

            TestRuntime.ValidateInstantiationException(sub, TestExpressionTracer.GetExceptionMessage <int, string, string>(exp.ExpressionType.Subtract));
        }
예제 #13
0
        public void ConstraintViolatonInvalidExpression()
        {
            TestCast <string, int> cast = new TestCast <string, int> {
                Operand = "Hello"
            };

            string errorMessage = TestExpressionTracer.GetExceptionMessage <string, int>(System.Linq.Expressions.ExpressionType.Convert);

            TestExpressionTracer.Validate(cast, new List <string> {
                errorMessage
            });
        }
예제 #14
0
        public void TryGreaterThanOnIncompatibleTypes()
        {
            TestGreaterThan <int, string, bool> greaterThan = new TestGreaterThan <int, string, bool> {
                Left = 1, Right = "1"
            };

            string error = TestExpressionTracer.GetExceptionMessage <int, string, bool>(System.Linq.Expressions.ExpressionType.GreaterThan);

            TestRuntime.ValidateWorkflowErrors(greaterThan, new List <TestConstraintViolation>()
            {
                new TestConstraintViolation(error, greaterThan.ProductActivity)
            }, error);
        }
예제 #15
0
        public void TryCastingUnrelatedTypes()
        {
            TestCast <string, int> cast = new TestCast <string, int> {
                Operand = "Hello"
            };

            string errorMessage = TestExpressionTracer.GetExceptionMessage <string, int>(System.Linq.Expressions.ExpressionType.Convert);

            TestRuntime.ValidateWorkflowErrors(cast, new List <TestConstraintViolation>()
            {
                new TestConstraintViolation(errorMessage, cast.ProductActivity, false)
            }, errorMessage);
        }
예제 #16
0
        public void TryLessThanOrEqualOnIncompatibleTypes()
        {
            TestLessThanOrEqual <int, string, bool> lessThanOrEqual = new TestLessThanOrEqual <int, string, bool> {
                Left = 1, Right = "1"
            };

            string error = TestExpressionTracer.GetExceptionMessage <int, string, bool>(System.Linq.Expressions.ExpressionType.LessThanOrEqual);

            TestRuntime.ValidateWorkflowErrors(lessThanOrEqual, new List <TestConstraintViolation>()
            {
                new TestConstraintViolation(error, lessThanOrEqual.ProductActivity)
            }, error);
        }
예제 #17
0
        public void ConstraintViolatonInvalidExpression()
        {
            TestGreaterThan <PublicType, string, bool> greaterThan = new TestGreaterThan <PublicType, string, bool>
            {
                LeftExpression = context => new PublicType(),
                Right          = "1"
            };

            string error = TestExpressionTracer.GetExceptionMessage <PublicType, string, bool>(System.Linq.Expressions.ExpressionType.GreaterThan);

            TestExpressionTracer.Validate(greaterThan, new List <string> {
                error
            });
        }
예제 #18
0
        public void ConstraintViolatonInvalidExpression()
        {
            TestLessThanOrEqual <PublicType, string, bool> lessThanOrEqual = new TestLessThanOrEqual <PublicType, string, bool>
            {
                LeftExpression = context => new PublicType(),
                Right          = "1"
            };

            string error = TestExpressionTracer.GetExceptionMessage <PublicType, string, bool>(System.Linq.Expressions.ExpressionType.LessThanOrEqual);

            TestExpressionTracer.Validate(lessThanOrEqual, new List <string> {
                error
            });
        }
예제 #19
0
        public void SubtractTwoIncompatibleTypes()
        {
            TestDivide <int, double, double> divide = new TestDivide <int, double, double>(4, 4.2);

            TestRuntime.ValidateInstantiationException(divide, TestExpressionTracer.GetExceptionMessage <int, double, double>(System.Linq.Expressions.ExpressionType.Divide));
        }