Exemplo n.º 1
0
 public void TestAssertPhoneNumber_CorrectlyValue()
 {
     Assert.DoesNotThrow(() =>
     {
         StringValidator.AssertPhoneNumber("78005553535", 11);
     }, "Incorrect date values");
 }
Exemplo n.º 2
0
 public void TestAssertPhoneNumber_IncorrectValue(string number,
                                                  int maxCount, string message)
 {
     Assert.Throws <ArgumentException>(() =>
     {
         StringValidator.AssertPhoneNumber(number,
                                           maxCount);
     }, message);
 }
Exemplo n.º 3
0
 private void PhoneMaskedTextBox_MaskInputRejected(object sender, MaskInputRejectedEventArgs e)
 {
     try
     {
         StringValidator.AssertPhoneNumber(Convert.ToInt64(
                                               StringValidator.GetClearPhoneNumber(
                                                   PhoneMaskedTextBox.Text)),
                                           PhoneNumber.MAXDIGITCOUNT);
         PhoneMaskedTextBox.BackColor = Color.White;
     }
     catch (ArgumentException)
     {
         PhoneMaskedTextBox.BackColor = Color.LightSalmon;
     }
 }