示例#1
0
        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);
        }
示例#2
0
        public void InvalidPhoneNumberTest()
        {
            string testPhone = "1-555-5555";

            Assert.IsFalse(DataValidations.IsValidPhoneNumber(testPhone));
        }
示例#3
0
        public void ValidPhoneNumberTest()
        {
            string testPhone = "2400-38-85";

            Assert.IsTrue(DataValidations.IsValidPhoneNumber(testPhone));
        }