@Test public void validateCorrectPhoneNumber() throws Exception { ValidatorsTestSuite.assertValidationResultOK(validator, validator.validate("123-456-7890")); ValidatorsTestSuite.assertValidationResultOK(validator, validator.validate("123.456.7890")); ValidatorsTestSuite.assertValidationResultOK(validator, validator.validate("123 456 7890")); ValidatorsTestSuite.assertValidationResultOK(validator, validator.validate("(123) 456 7890")); ValidatorsTestSuite.assertValidationResultOK( validator, validator.validate("+1 (123) 456-7890")); ValidatorsTestSuite.assertValidationResultOK(validator, validator.validate("1-123-456-7890")); ValidatorsTestSuite.assertValidationResultOK(validator, validator.validate("11234567890")); }
@Test public void validateEmptyValue() throws Exception { ValidatorsTestSuite.assertValidationResultOK(validator, validator.validate("")); }
@Test public void validateNullValue() throws Exception { ValidatorsTestSuite.assertValidationResultOK(validator, validator.validate(null)); }