public void IsValidMinLengthMustReturnTrueWhenTheSpecifiedValueLenghtIsBigger() { LengthValidator lengthValidator = new LengthValidator(1); Assert.IsTrue(lengthValidator.IsValid("1")); Assert.IsTrue(lengthValidator.IsValid("123")); }
public void IsValidBetweenLengthMustReturnTrueWhenTheSpecifiedValueLenghtIsOutsideTheBoundaries() { LengthValidator lengthValidator = new LengthValidator(1, 5); Assert.IsTrue(lengthValidator.IsValid("1")); Assert.IsTrue(lengthValidator.IsValid("123")); Assert.IsTrue(lengthValidator.IsValid("12345")); }
public void IsValidMinLengthMustReturnFalseWhenTheSpecifiedValueLenghtIsSmaller() { LengthValidator lengthValidator = new LengthValidator(5); Assert.IsFalse(lengthValidator.IsValid(string.Empty)); Assert.IsFalse(lengthValidator.IsValid("1")); Assert.IsFalse(lengthValidator.IsValid("1234")); }
public void IsValidBetweenLengthMustReturnFalseWhenTheSpecifiedValueLenghtIsOutsideTheBoundaries() { LengthValidator lengthValidator = new LengthValidator(2, 4); Assert.IsFalse(lengthValidator.IsValid(string.Empty)); Assert.IsFalse(lengthValidator.IsValid("1")); Assert.IsFalse(lengthValidator.IsValid("12345")); }
public void IsValidMinLengthMustReturnTrueWhenTheSpecifiedValueIsNull() { LengthValidator lengthValidator = new LengthValidator(5); Assert.IsTrue(lengthValidator.IsValid(null)); }