Esempio n. 1
0
        public void TwoBooleansInOr()
        {
            TestOr <bool, bool, bool> or = new TestOr <bool, bool, bool>(false, true);

            TestSequence seq = TestExpressionTracer.GetTraceableBinaryExpressionActivity <bool, bool, bool>(or, true.ToString());

            TestRuntime.RunAndValidateWorkflow(seq);
        }
Esempio n. 2
0
        public void DivideTwoPositiveIntegers()
        {
            TestDivide <int, int, int> divide = new TestDivide <int, int, int>(12, 4);

            TestSequence seq = TestExpressionTracer.GetTraceableBinaryExpressionActivity <int, int, int>(divide, "3");

            TestRuntime.RunAndValidateWorkflow(seq);
        }
Esempio n. 3
0
        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));
        }
Esempio n. 4
0
        public void TwoBooleansInAnd()
        {
            TestAnd <bool, bool, bool> and = new TestAnd <bool, bool, bool>(true, false);

            TestSequence seq = TestExpressionTracer.GetTraceableBinaryExpressionActivity <bool, bool, bool>(and, false.ToString());

            TestRuntime.RunAndValidateWorkflow(seq);
        }
Esempio n. 5
0
        public void CompareTwoIntegers()
        {
            TestGreaterThan <int, int, bool> greaterThan = new TestGreaterThan <int, int, bool>(2, 3);

            TestSequence seq = TestExpressionTracer.GetTraceableBinaryExpressionActivity <int, int, bool>(greaterThan, false.ToString());

            TestRuntime.RunAndValidateWorkflow(seq);
        }
Esempio n. 6
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));
        }
Esempio n. 7
0
        public void CompareTwoBooleans()
        {
            TestEqual <bool, bool, bool> equal = new TestEqual <bool, bool, bool>(true, false);

            TestSequence seq = TestExpressionTracer.GetTraceableBinaryExpressionActivity <bool, bool, bool>(equal, false.ToString());

            TestRuntime.RunAndValidateWorkflow(seq);
        }
Esempio n. 8
0
        public void ComputeIntegralAnd()
        {
            TestAnd <int, int, int> and = new TestAnd <int, int, int>(2, 2); //010 & 010 = 010

            TestSequence seq = TestExpressionTracer.GetTraceableBinaryExpressionActivity <int, int, int>(and, "2");

            TestRuntime.RunAndValidateWorkflow(seq);
        }
Esempio n. 9
0
        public void SubtractTwoPositiveIntegers()
        {
            TestSubtract <int, int, int> sub = new TestSubtract <int, int, int>(4, 4);

            TestSequence seq = TestExpressionTracer.GetTraceableBinaryExpressionActivity <int, int, int>(sub, "0");

            TestRuntime.RunAndValidateWorkflow(seq);
        }
Esempio n. 10
0
        public void MultiplyTwoPositiveIntegers()
        {
            TestMultiply <int, int, int> multiply = new TestMultiply <int, int, int>(3, 4);

            TestSequence seq = TestExpressionTracer.GetTraceableBinaryExpressionActivity <int, int, int>(multiply, "12");

            TestRuntime.RunAndValidateWorkflow(seq);
        }
Esempio n. 11
0
        public void TwoBooleansInOrElse()
        {
            TestOrElse orElse = new TestOrElse(false, true);

            TestSequence seq = TestExpressionTracer.GetTraceableBoolResultActivity(orElse, true.ToString());

            TestRuntime.RunAndValidateWorkflow(seq);
        }
Esempio n. 12
0
        public void TwoBooleansInAndAlso()
        {
            TestAndAlso andAlso = new TestAndAlso(true, false);

            TestSequence seq = TestExpressionTracer.GetTraceableBoolResultActivity(andAlso, false.ToString());

            TestRuntime.RunAndValidateWorkflow(seq);
        }
Esempio n. 13
0
        public void CompareTwoIntegers()
        {
            TestLessThanOrEqual <int, int, bool> lessThanOrEqual = new TestLessThanOrEqual <int, int, bool>(2, 2);

            TestSequence seq = TestExpressionTracer.GetTraceableBinaryExpressionActivity <int, int, bool>(lessThanOrEqual, true.ToString());

            TestRuntime.RunAndValidateWorkflow(seq);
        }
Esempio n. 14
0
        public void AddTwoPositiveIntegers()
        {
            TestAdd <int, int, int> add = new TestAdd <int, int, int>(3, 4);

            TestSequence seq = TestExpressionTracer.GetTraceableBinaryExpressionActivity <int, int, int>(add, "7");

            TestRuntime.RunAndValidateWorkflow(seq);
        }
Esempio n. 15
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));
        }
Esempio n. 16
0
        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));
        }
Esempio n. 17
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
            });
        }
Esempio n. 18
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));
        }
Esempio n. 19
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));
        }
Esempio n. 20
0
        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
            });
        }
Esempio n. 21
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
            });
        }
Esempio n. 22
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));
        }
Esempio n. 23
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
            });
        }
Esempio n. 24
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
            });
        }
Esempio n. 25
0
        public void ConstraintErrorForPropertyNameNull()
        {
            TestPropertyValue <PublicType, int> propertyValue = new TestPropertyValue <PublicType, int>
            {
                OperandExpression = context => new PublicType()
            };

            TestExpressionTracer.Validate(propertyValue, new List <string> {
                string.Format(ErrorStrings.ActivityPropertyMustBeSet, "PropertyName", propertyValue.DisplayName)
            });
        }
Esempio n. 26
0
        public void EvaluateNotOfBoolean()
        {
            TestNot <bool, bool> not = new TestNot <bool, bool>
            {
                Operand = true
            };

            TestSequence seq = TestExpressionTracer.GetTraceableUnaryExpressionActivity <bool, bool>(not, false.ToString());

            TestRuntime.RunAndValidateWorkflow(seq);
        }
Esempio n. 27
0
        public void CustomTypeOperandWithOperatorOverloaded()
        {
            TestNot <Complex, Complex> complexNot = new TestNot <Complex, Complex>()
            {
                OperandExpression = context => new Complex(1, 0)
            };

            TestSequence seq = TestExpressionTracer.GetTraceableUnaryExpressionActivity <Complex, Complex>(complexNot, new Complex(0, 1).ToString());

            TestRuntime.RunAndValidateWorkflow(seq);
        }
Esempio n. 28
0
        public void ConstraintErrorForInvalidProperty()
        {
            TestPropertyValue <PublicType, int> propertyValue = new TestPropertyValue <PublicType, int>
            {
                OperandExpression = context => new PublicType(),
                PropertyName      = "Invalid"
            };

            TestExpressionTracer.Validate(propertyValue, new List <string> {
                string.Format(ErrorStrings.MemberNotFound, "Invalid", typeof(PublicType).Name)
            });
        }
Esempio n. 29
0
        public void ConstraintErrorForInvalidArguments()
        {
            TestNew <Complex> myNew = new TestNew <Complex>();

            myNew.Arguments.Add(new TestArgument <int>(Direction.In, "Real", 1));

            string error = string.Format(ErrorStrings.ConstructorInfoNotFound, typeof(Complex).Name);

            TestExpressionTracer.Validate(myNew, new List <string> {
                error
            });
        }
Esempio n. 30
0
        public void CustomTypeOperandWithOperatorOverloaded()
        {
            TestOr <Complex, Complex, Complex> complexOr = new TestOr <Complex, Complex, Complex>()
            {
                LeftExpression  = context => new Complex(1, 2),
                RightExpression = context => new Complex(2, 3)
            };

            TestSequence seq = TestExpressionTracer.GetTraceableBinaryExpressionActivity <Complex, Complex, Complex>(complexOr, new Complex(1 | 2, 2 | 3).ToString());

            TestRuntime.RunAndValidateWorkflow(seq);
        }