Added ability to get county via zip (en-US locale only)
This commit is contained in:
parent
6fc2a3b0a5
commit
f73dd19086
@ -35,7 +35,13 @@ public class Address {
|
||||
return faker.bothify(faker.fakeValuesService().resolve("address.postcode", this,faker));
|
||||
}
|
||||
|
||||
public String zipCodeByState(String stateAbbr) { return faker.fakeValuesService().resolve("address.postcode_by_state." + stateAbbr, this, faker); }
|
||||
public String zipCodeByState(String stateAbbr) {
|
||||
return faker.fakeValuesService().resolve("address.postcode_by_state." + stateAbbr, this, faker);
|
||||
}
|
||||
|
||||
public String countyByZipCode(String postCode) {
|
||||
return faker.fakeValuesService().resolve("address.county_by_postcode." + postCode, this, faker);
|
||||
}
|
||||
|
||||
public String streetSuffix() {
|
||||
return faker.fakeValuesService().resolve("address.street_suffix", this, faker);
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -106,4 +106,10 @@ public class AddressTest extends AbstractFakerTest {
|
||||
faker = new Faker(new Locale("en-US"));
|
||||
assertThat(faker.address().zipCodeByState(faker.address().stateAbbr()), matchesRegularExpression("[0-9]{5}"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCountyByZipCode() {
|
||||
faker = new Faker(new Locale("en-US"));
|
||||
assertThat(faker.address().countyByZipCode(faker.address().zipCodeByState(faker.address().stateAbbr())), not(isEmptyOrNullString()));
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user