public static bool ValidatePhoneNumber(string aPhoneNumber, Label aMsgLabel) { bool valid = DataValidations.IsValidPhoneNumber(aPhoneNumber); if (valid) { OkMessage(aMsgLabel, "OK"); } else { ErrorMessage(aMsgLabel, "Invalid phone number"); } return(valid); }
public void InvalidPhoneNumberTest() { string testPhone = "1-555-5555"; Assert.IsFalse(DataValidations.IsValidPhoneNumber(testPhone)); }
public void ValidPhoneNumberTest() { string testPhone = "2400-38-85"; Assert.IsTrue(DataValidations.IsValidPhoneNumber(testPhone)); }