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 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 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 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() { 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 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() { 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 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 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 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 ConstraintViolatonInvalidExpression() { TestCast <string, int> cast = new TestCast <string, int> { Operand = "Hello" }; string errorMessage = TestExpressionTracer.GetExceptionMessage <string, int>(System.Linq.Expressions.ExpressionType.Convert); TestExpressionTracer.Validate(cast, new List <string> { errorMessage }); }
public void TryGreaterThanOnIncompatibleTypes() { TestGreaterThan <int, string, bool> greaterThan = new TestGreaterThan <int, string, bool> { Left = 1, Right = "1" }; string error = TestExpressionTracer.GetExceptionMessage <int, string, bool>(System.Linq.Expressions.ExpressionType.GreaterThan); TestRuntime.ValidateWorkflowErrors(greaterThan, new List <TestConstraintViolation>() { new TestConstraintViolation(error, greaterThan.ProductActivity) }, error); }
public void TryCastingUnrelatedTypes() { TestCast <string, int> cast = new TestCast <string, int> { Operand = "Hello" }; string errorMessage = TestExpressionTracer.GetExceptionMessage <string, int>(System.Linq.Expressions.ExpressionType.Convert); TestRuntime.ValidateWorkflowErrors(cast, new List <TestConstraintViolation>() { new TestConstraintViolation(errorMessage, cast.ProductActivity, false) }, errorMessage); }
public void TryLessThanOrEqualOnIncompatibleTypes() { TestLessThanOrEqual <int, string, bool> lessThanOrEqual = new TestLessThanOrEqual <int, string, bool> { Left = 1, Right = "1" }; string error = TestExpressionTracer.GetExceptionMessage <int, string, bool>(System.Linq.Expressions.ExpressionType.LessThanOrEqual); TestRuntime.ValidateWorkflowErrors(lessThanOrEqual, new List <TestConstraintViolation>() { new TestConstraintViolation(error, lessThanOrEqual.ProductActivity) }, error); }
public void ConstraintViolatonInvalidExpression() { TestGreaterThan <PublicType, string, bool> greaterThan = new TestGreaterThan <PublicType, string, bool> { LeftExpression = context => new PublicType(), Right = "1" }; string error = TestExpressionTracer.GetExceptionMessage <PublicType, string, bool>(System.Linq.Expressions.ExpressionType.GreaterThan); TestExpressionTracer.Validate(greaterThan, new List <string> { error }); }
public void ConstraintViolatonInvalidExpression() { TestLessThanOrEqual <PublicType, string, bool> lessThanOrEqual = new TestLessThanOrEqual <PublicType, string, bool> { LeftExpression = context => new PublicType(), Right = "1" }; string error = TestExpressionTracer.GetExceptionMessage <PublicType, string, bool>(System.Linq.Expressions.ExpressionType.LessThanOrEqual); TestExpressionTracer.Validate(lessThanOrEqual, new List <string> { error }); }
public void SubtractTwoIncompatibleTypes() { TestDivide <int, double, double> divide = new TestDivide <int, double, double>(4, 4.2); TestRuntime.ValidateInstantiationException(divide, TestExpressionTracer.GetExceptionMessage <int, double, double>(System.Linq.Expressions.ExpressionType.Divide)); }