예제 #1
0
        public void ValidationFailsForInvalidTelephoneNumbers()
        {
            TelephoneNumberValidator validator = new TelephoneNumberValidator("GB");

            Assert.IsFalse(validator.IsValid(this, "0000"));
            Assert.IsFalse(validator.IsValid(this, "ABCDEFGH"));
        }
예제 #2
0
        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"));
        }
예제 #3
0
        public void ExceptionThrownForCulturesWithoutASpecifiedExpression()
        {
            TelephoneNumberValidator validator = new TelephoneNumberValidator("NI");

            validator.IsValid(this, "012345");
        }