Beispiel #1
0
        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'");
        }
Beispiel #2
0
 public TypeConstraint(string constraintType, ITypeOperator op)
 {
     ConstraintType = constraintType;
     Operator       = op;
 }
Beispiel #3
0
 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");
 }
Beispiel #4
0
 public void GetTypeOperatorChecker(int value, string typeOperatorName)
 {
     _typeOperator = new TypeOperator(typeOperatorName, new [] { value });
 }