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); }
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); }
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)); }
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); }
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); }
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)); }
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); }
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); }
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); }
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); }
public void TwoBooleansInOrElse() { TestOrElse orElse = new TestOrElse(false, true); TestSequence seq = TestExpressionTracer.GetTraceableBoolResultActivity(orElse, true.ToString()); TestRuntime.RunAndValidateWorkflow(seq); }
public void TwoBooleansInAndAlso() { TestAndAlso andAlso = new TestAndAlso(true, false); TestSequence seq = TestExpressionTracer.GetTraceableBoolResultActivity(andAlso, false.ToString()); TestRuntime.RunAndValidateWorkflow(seq); }
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); }
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); }
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)); }
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)); }
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 }); }
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)); }
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)); }
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 }); }
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 }); }
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)); }
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 }); }
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 }); }
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) }); }
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); }
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); }
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) }); }
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 }); }
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); }