예제 #1
0
        public void Should_validate_value_of_length_16()
        {
            var value = "1234567890123456";

            var validationRule = new ExactLengthValidationRule();

            validationRule.Length = 16;
            var result = validationRule.Validate(value, null);

            Assert.IsTrue(result.IsValid);
        }
예제 #2
0
        public void Should_not_validate_value_of_more_than_16()
        {
            var value = "12345678901234567";

            var validationRule = new ExactLengthValidationRule();

            validationRule.Length = 16;
            var result = validationRule.Validate(value, null);

            Assert.IsFalse(result.IsValid);
            Assert.IsNotNull(result.ErrorContent);
        }