Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
        public void ThrowFromOverloadedOperator()
        {
            TestNot <OverLoadOperatorThrowingType, bool> not = new TestNot <OverLoadOperatorThrowingType, bool>
            {
                OperandExpression = context => new OverLoadOperatorThrowingType(13)
            };

            OverLoadOperatorThrowingType.ThrowException = true;

            not.ExpectedOutcome = Outcome.UncaughtException();

            TestSequence seq = TestExpressionTracer.GetTraceableUnaryExpressionActivity <OverLoadOperatorThrowingType, bool>(not, "12");

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