|
|
|
@ -47,6 +47,8 @@ public class PhoneNumberOfflineGeocoderTest extends TestCase { |
|
|
|
new PhoneNumber().setCountryCode(1).setNationalNumber(6509600000L); |
|
|
|
private static final PhoneNumber US_NUMBER3 = |
|
|
|
new PhoneNumber().setCountryCode(1).setNationalNumber(2128120000L); |
|
|
|
private static final PhoneNumber US_NUMBER4 = |
|
|
|
new PhoneNumber().setCountryCode(1).setNationalNumber(6174240000L); |
|
|
|
private static final PhoneNumber US_INVALID_NUMBER = |
|
|
|
new PhoneNumber().setCountryCode(1).setNationalNumber(123456789L); |
|
|
|
private static final PhoneNumber BS_NUMBER1 = |
|
|
|
@ -71,6 +73,13 @@ public class PhoneNumberOfflineGeocoderTest extends TestCase { |
|
|
|
new Locale("en", "US"))); |
|
|
|
} |
|
|
|
|
|
|
|
public void testGetDescriptionForNumberWithMissingPrefix() { |
|
|
|
// Test that the name of the country is returned when the number passed in is valid but not |
|
|
|
// covered by the geocoding data file. |
|
|
|
assertEquals("United States", |
|
|
|
geocoder.getDescriptionForNumber(US_NUMBER4, new Locale("en", "US"))); |
|
|
|
} |
|
|
|
|
|
|
|
public void testGetDescriptionForNumber_en_US() { |
|
|
|
assertEquals("CA", |
|
|
|
geocoder.getDescriptionForNumber(US_NUMBER1, new Locale("en", "US"))); |
|
|
|
|