Exemplo n.º 1
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);
        }
Exemplo n.º 2
0
        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            TestAdd t = new TestAdd();

            t.Show();
            //PortraitForm fc = new PortraitForm();
            //List<string> d = new List<string>() { "да", "нет" };
            //fc.Create("tmp.pdf", 232, 2, d, 29);
        }
Exemplo n.º 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));
        }
Exemplo n.º 4
0
        public void ConstraintViolationIncompatibleTypes()
        {
            TestAdd <int, string, string> add = new TestAdd <int, string, string>();

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

            TestExpressionTracer.Validate(add, new List <string> {
                errorMessage
            });
        }
Exemplo n.º 5
0
        public void LeftOperandNull()
        {
            TestAdd <int, int, int> add = new TestAdd <int, int, int>
            {
                Right = 12
            };

            string errorMessage = string.Format(ErrorStrings.RequiredArgumentValueNotSupplied, "Left");

            TestRuntime.ValidateWorkflowErrors(add, new List <TestConstraintViolation>(), typeof(ArgumentException), errorMessage);
        }
Exemplo n.º 6
0
        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);
        }
Exemplo n.º 7
0
        public void CustomTypeOverloadedAddOperatorAsOperands()
        {
            TestAdd <Complex, Complex, Complex> addComplex = new TestAdd <Complex, Complex, Complex>()
            {
                LeftExpression  = context => new Complex(1, 2),
                RightExpression = context => new Complex(2, 3),
            };

            TestSequence seq = TestExpressionTracer.GetTraceableBinaryExpressionActivity <Complex, Complex, Complex>(addComplex, "3 5");

            TestRuntime.RunAndValidateWorkflow(seq);
        }
Exemplo n.º 8
0
        public void CheckedAddOverflow()
        {
            //
            //  Test case description:
            //  add two integers which result in overflow of integer. OverflowException is expected.

            TestAdd <int, int, int> add = new TestAdd <int, int, int>()
            {
                Checked             = true,
                Right               = int.MaxValue,
                Left                = 1,
                HintExceptionThrown = typeof(OverflowException)
            };

            TestRuntime.RunAndValidateAbortedException(add, typeof(OverflowException), null);
        }