コード例 #1
0
        public void CharLenIsWithinRange()
        {
            TextLengthValidationRule text_val = new TextLengthValidationRule(10, 15);
            ValidationResult         result   = text_val.Validate("Adwsdwjfhw 345", null);

            Assert.AreEqual(new ValidationResult(true, null), result);
        }
コード例 #2
0
        public void FieldIsNull()
        {
            TextLengthValidationRule text_val = new TextLengthValidationRule(2, 30);
            ValidationResult         result   = text_val.Validate(null, null);

            Assert.AreEqual(new ValidationResult(false, text_val.failure_message), result);
        }
コード例 #3
0
        public void CharLenIsEqualTwo()
        {
            TextLengthValidationRule text_val = new TextLengthValidationRule(2, 30);
            ValidationResult         result   = text_val.Validate("bb", null);

            Assert.AreEqual(new ValidationResult(true, null), result);
        }
コード例 #4
0
        public void CharLenIsEqualThirty()
        {
            TextLengthValidationRule text_val = new TextLengthValidationRule(2, 30);
            ValidationResult         result   = text_val.Validate("p.Brzęczyszczykiewicz Grzegorz", null);

            Assert.AreEqual(new ValidationResult(true, null), result);
        }
コード例 #5
0
        public void CharLenHigherThanThirty()
        {
            TextLengthValidationRule text_val = new TextLengthValidationRule(2, 30);
            ValidationResult         result   = text_val.Validate("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", null);

            Assert.AreEqual(new ValidationResult(false, text_val.failure_message), result);
        }