public void ValidationFailsForInvalidTelephoneNumbers() { TelephoneNumberValidator validator = new TelephoneNumberValidator("GB"); Assert.IsFalse(validator.IsValid(this, "0000")); Assert.IsFalse(validator.IsValid(this, "ABCDEFGH")); }
public void ValidationPassesForValidTelephoneNumbers() { TelephoneNumberValidator validator = new TelephoneNumberValidator("GB"); Assert.IsTrue(validator.IsValid(this, "01234567890")); Assert.IsTrue(validator.IsValid(this, "012 3456 7890")); Assert.IsTrue(validator.IsValid(this, "0123 4567890")); }
public void ExceptionThrownForCulturesWithoutASpecifiedExpression() { TelephoneNumberValidator validator = new TelephoneNumberValidator("NI"); validator.IsValid(this, "012345"); }