Exemple #1
0
        private static bool Match(string number, PhoneRegex pattern, bool allowPrefixMatch)
        {
            var matcher = pattern.MatchBeginning(number);

            if (!matcher.Success)
            {
                return(false);
            }

            return(pattern.MatchAll(number).Success || allowPrefixMatch);
        }
 private static bool Match(string number, PhoneRegex pattern, bool allowPrefixMatch)
 => allowPrefixMatch?pattern.IsMatchBeginning(number) : pattern.IsMatchAll(number);
Exemple #3
0
        public void GetGeneratedPhoneNumber_Works()
        {
            var phoneNumber = LeadGenerator.GetGeneratedPhoneNumber(new StringBuilder(), new Random());

            Assert.IsTrue(PhoneRegex.IsMatch(phoneNumber));
        }