Ejemplo n.º 1
0
 public void South_African_international_phone_numbers_must_be_no_more_than_eleven_digits_long()
 {
     try
     {
         TelephoneNumber.FromString("+271133321632");
         Assert.Fail("The expected exception was not thrown");
     }
     catch (Exception ex)
     {
         ex.ShouldBeOfType <InvalidPhoneNumberException>();
     }
 }
Ejemplo n.º 2
0
 public void Local_numbers_must_be_no_less_than_ten_digits_long()
 {
     try
     {
         TelephoneNumber.FromString("084514090");
         Assert.Fail("The expected exception was not thrown");
     }
     catch (Exception ex)
     {
         ex.ShouldBeOfType <InvalidPhoneNumberException>();
     }
 }
Ejemplo n.º 3
0
        public void Non_cellular_numbers_cannot_receive_sms_messages()
        {
            var phoneNumber = TelephoneNumber.FromString("+27113332163");

            phoneNumber.CanRecieveSms().ShouldBe(false);
        }
Ejemplo n.º 4
0
        public void South_African_international_phone_number_format_is_accepted()
        {
            var phoneNumber = TelephoneNumber.FromString("+27845140900");

            phoneNumber.ToString().ShouldBe("0845140900");
        }
Ejemplo n.º 5
0
        public void Cellular_numbers_can_receive_sms_messages()
        {
            var phoneNumber = TelephoneNumber.FromString("+27845140900");

            phoneNumber.CanRecieveSms().ShouldBe(true);
        }
Ejemplo n.º 6
0
 public void Can_hash_phone_number()
 {
     TelephoneNumber.FromString("0605693825").ToMaskedString(0, 6, '*').ShouldBe("******3825");
     TelephoneNumber.FromString("0605693825").ToMaskedString(3, 1, '#').ShouldBe("060#693825");
 }
Ejemplo n.º 7
0
        public void Local_phone_number_format_is_accepted()
        {
            var phoneNumber = TelephoneNumber.FromString("0845140900");

            phoneNumber.ToString().ShouldBe("0845140900");
        }
Ejemplo n.º 8
0
 public void Area_code_06_can_receive_sms()
 {
     TelephoneNumber.FromString("0605693825").CanRecieveSms().ShouldBe(true);
 }
Ejemplo n.º 9
0
 public void Area_code_may_have_thrid_digit_as_zero()
 {
     TelephoneNumber.FromString("0605693825").ToString().ShouldBe("0605693825");
 }
Ejemplo n.º 10
0
 public void Area_code_may_not_have_second_digit_as_zero()
 {
     TelephoneNumber.FromString("0005693825");
 }
Ejemplo n.º 11
0
 public void Area_code_must_have_first_digit_as_zero()
 {
     TelephoneNumber.FromString("1605693825");
 }
Ejemplo n.º 12
0
 public void A_phone_number_may_contain_formatting_characters()
 {
     TelephoneNumber.FromString("+27-11-333-2163").ToString().ShouldBe("0113332163");
     TelephoneNumber.FromString("+27 11 333 2163").ToString().ShouldBe("0113332163");
     TelephoneNumber.FromString("(011)-333-2163").ToString().ShouldBe("0113332163");
 }