public void TestGetTypeOperator_When_UppercaseLetter_Then_Exception() { Action act = () => _typeOperator = new TypeOperator("In", new[] { 3, 5, 7, 9 }); act.ShouldThrow <ArgumentException>() .WithMessage( "Can't convert 'In' to TypeOperatorName. Legal values are '=', '<', '>', '<=', '>=', 'in'"); }
public TypeConstraint(string constraintType, ITypeOperator op) { ConstraintType = constraintType; Operator = op; }
public void TestTypeOperatorChecker_When_In() { _typeOperator = new TypeOperator("in", new[] { 3, 5, 7, 9 }); _typeOperator.IsWithinConstraint(3).Should().BeTrue("because its' an odd number"); _typeOperator.IsWithinConstraint(2).Should().BeFalse("because it's an even number"); }
public void GetTypeOperatorChecker(int value, string typeOperatorName) { _typeOperator = new TypeOperator(typeOperatorName, new [] { value }); }