コード例 #1
0
ファイル: And.cs プロジェクト: stephensmitchell-forks/corewf
        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);
        }
コード例 #2
0
ファイル: And.cs プロジェクト: stephensmitchell-forks/corewf
        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);
        }
コード例 #3
0
ファイル: GreaterThan.cs プロジェクト: sunxiaotianmg/CoreWF
        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);
        }
コード例 #4
0
ファイル: Add.cs プロジェクト: stephensmitchell-forks/corewf
        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);
        }
コード例 #5
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);
        }
コード例 #6
0
ファイル: Or.cs プロジェクト: sunxiaotianmg/CoreWF
        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);
        }
コード例 #7
0
ファイル: LessThanOrEqual.cs プロジェクト: jimitndiaye/corewf
        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);
        }
コード例 #8
0
ファイル: Subtract.cs プロジェクト: jbzorg/corewf
        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);
        }
コード例 #9
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);
        }
コード例 #10
0
ファイル: Multiply.cs プロジェクト: jimitndiaye/corewf
        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);
        }
コード例 #11
0
ファイル: And.cs プロジェクト: stephensmitchell-forks/corewf
        public void CustomTypeOperandWithOperatorOverloaded()
        {
            TestAnd <OverLoadOperatorThrowingType, OverLoadOperatorThrowingType, OverLoadOperatorThrowingType> testAnd = new TestAnd <OverLoadOperatorThrowingType, OverLoadOperatorThrowingType, OverLoadOperatorThrowingType>();

            testAnd.ProductAnd.Left  = new InArgument <OverLoadOperatorThrowingType>(context => new OverLoadOperatorThrowingType(13));
            testAnd.ProductAnd.Right = new InArgument <OverLoadOperatorThrowingType>(context => new OverLoadOperatorThrowingType(14));
            OverLoadOperatorThrowingType.ThrowException = false;

            TestSequence seq = TestExpressionTracer.GetTraceableBinaryExpressionActivity <OverLoadOperatorThrowingType, OverLoadOperatorThrowingType, OverLoadOperatorThrowingType>(testAnd, "12"); //1101 & 1110 = 1100

            TestRuntime.RunAndValidateWorkflow(seq);
        }
コード例 #12
0
ファイル: Subtract.cs プロジェクト: jbzorg/corewf
        public void CustomTypeOverloadedSubOperatorAsOperands()
        {
            TestSubtract <Complex, Complex, Complex> subComplex = new TestSubtract <Complex, Complex, Complex>
            {
                LeftExpression  = context => new Complex(1, 2),
                RightExpression = context => new Complex(2, 3),
            };

            TestSequence seq = TestExpressionTracer.GetTraceableBinaryExpressionActivity <Complex, Complex, Complex>(subComplex, "-1 -1");

            TestRuntime.RunAndValidateWorkflow(seq);
        }
コード例 #13
0
ファイル: Subtract.cs プロジェクト: jbzorg/corewf
        public void SubtractTwoCompatibleDifferentTypes()
        {
            TestSubtract <DateTime, TimeSpan, DateTime> sub = new TestSubtract <DateTime, TimeSpan, DateTime>
            {
                Left  = new DateTime(2009, 2, 12),
                Right = new TimeSpan(17, 58, 59)
            };

            TestSequence seq = TestExpressionTracer.GetTraceableBinaryExpressionActivity(sub, new DateTime(2009, 2, 11, 06, 01, 01).ToString());

            TestRuntime.RunAndValidateWorkflow(seq);
        }
コード例 #14
0
ファイル: Add.cs プロジェクト: stephensmitchell-forks/corewf
        public void AddTwoCompatibleDifferentTypes()
        {
            TestAdd <DateTime, TimeSpan, DateTime> add = new TestAdd <DateTime, TimeSpan, DateTime>
            {
                Left  = new DateTime(2009, 2, 12),
                Right = new TimeSpan(17, 58, 59)
            };

            TestSequence seq = TestExpressionTracer.GetTraceableBinaryExpressionActivity <DateTime, TimeSpan, DateTime>(add, @"2/12/2009 5:58:59 PM");

            TestRuntime.RunAndValidateWorkflow(seq);
        }
コード例 #15
0
ファイル: Or.cs プロジェクト: sunxiaotianmg/CoreWF
        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);
        }
コード例 #16
0
ファイル: GreaterThan.cs プロジェクト: sunxiaotianmg/CoreWF
        public void CustomTypeOperandWithOperatorOverloaded()
        {
            TestGreaterThan <Complex, Complex, bool> greaterThan = new TestGreaterThan <Complex, Complex, bool>
            {
                LeftExpression  = context => new Complex(2, 3),
                RightExpression = context => new Complex(1, 4),
            };

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

            TestRuntime.RunAndValidateWorkflow(seq);
        }
コード例 #17
0
        public void CustomTypeOverloadedDivideOperatorAsOperands()
        {
            TestDivide <Complex, Complex, Complex> divide = new TestDivide <Complex, Complex, Complex>
            {
                LeftExpression  = context => new Complex(2, 6),
                RightExpression = context => new Complex(1, 2),
            };

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

            TestRuntime.RunAndValidateWorkflow(seq);
        }
コード例 #18
0
ファイル: And.cs プロジェクト: stephensmitchell-forks/corewf
        public void ThrowFromOverloadedOperator()
        {
            TestAnd <OverLoadOperatorThrowingType, OverLoadOperatorThrowingType, OverLoadOperatorThrowingType> testAnd = new TestAnd <OverLoadOperatorThrowingType, OverLoadOperatorThrowingType, OverLoadOperatorThrowingType>();

            testAnd.ProductAnd.Left  = new InArgument <OverLoadOperatorThrowingType>(context => new OverLoadOperatorThrowingType(13));
            testAnd.ProductAnd.Right = new InArgument <OverLoadOperatorThrowingType>(context => new OverLoadOperatorThrowingType(14));
            OverLoadOperatorThrowingType.ThrowException = true;

            testAnd.ExpectedOutcome = Outcome.UncaughtException();

            TestSequence seq = TestExpressionTracer.GetTraceableBinaryExpressionActivity <OverLoadOperatorThrowingType, OverLoadOperatorThrowingType, OverLoadOperatorThrowingType>(testAnd, "12");

            TestRuntime.RunAndValidateAbortedException(seq, typeof(DivideByZeroException), null);
        }
コード例 #19
0
ファイル: GreaterThan.cs プロジェクト: sunxiaotianmg/CoreWF
        public void ThrowFromOverloadedOperator()
        {
            TestGreaterThan <OverLoadOperatorThrowingType, OverLoadOperatorThrowingType, bool> greaterThan = new TestGreaterThan <OverLoadOperatorThrowingType, OverLoadOperatorThrowingType, bool>
            {
                LeftExpression  = context => new OverLoadOperatorThrowingType(2),
                RightExpression = context => new OverLoadOperatorThrowingType(1),
                ExpectedOutcome = Outcome.UncaughtException()
            };

            OverLoadOperatorThrowingType.ThrowException = true;

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

            TestRuntime.RunAndValidateAbortedException(seq, typeof(ArithmeticException), null);
        }
コード例 #20
0
ファイル: Or.cs プロジェクト: sunxiaotianmg/CoreWF
        public void ThrowFromOverloadedOperator()
        {
            TestOr <OverLoadOperatorThrowingType, OverLoadOperatorThrowingType, int> or = new TestOr <OverLoadOperatorThrowingType, OverLoadOperatorThrowingType, int>
            {
                LeftExpression  = context => new OverLoadOperatorThrowingType(13),
                RightExpression = context => new OverLoadOperatorThrowingType(14),
            };

            OverLoadOperatorThrowingType.ThrowException = true;

            or.ExpectedOutcome = Outcome.UncaughtException();

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

            TestRuntime.RunAndValidateAbortedException(seq, typeof(ArithmeticException), null);
        }