예제 #1
0
        public void InvalidTopNumberFailsValidation()
        {
            var anyMethodSetId      = 0;
            var invalidTopNumber    = 0;
            var methodIdNumberPairs = new MethodIdNumberPair(anyMethodSetId, invalidTopNumber);
            var validator           = new MethodIdNumberPairValidator();

            var result = validator.Validate(methodIdNumberPairs);

            Assert.IsFalse(result.IsValid);
        }
예제 #2
0
        public void InvalidMethodFailsValidation()
        {
            var invalidMethodSetId  = int.MaxValue;
            var anyTopNumber        = PrimeNumber.FIRST_PRIME_NUMBER;
            var methodIdNumberPairs = new MethodIdNumberPair(invalidMethodSetId, anyTopNumber);
            var validator           = new MethodIdNumberPairValidator();

            var result = validator.Validate(methodIdNumberPairs);

            Assert.IsFalse(result.IsValid);
        }
예제 #3
0
        public void ValidMethodIdNumberPairShouldNotHaveValidationErrors()
        {
            var anyMethodSetId      = 0;
            var anyTopNumber        = int.MaxValue;
            var methodIdNumberPairs = new MethodIdNumberPair(anyMethodSetId, anyTopNumber);
            var validator           = new MethodIdNumberPairValidator();

            var result = validator.Validate(methodIdNumberPairs);

            Assert.IsTrue(result.IsValid);
        }