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); }
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); }
public void CharLenIsEqualTwo() { TextLengthValidationRule text_val = new TextLengthValidationRule(2, 30); ValidationResult result = text_val.Validate("bb", null); Assert.AreEqual(new ValidationResult(true, null), result); }
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); }
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); }