Skip to content

Commit

Permalink
Merge pull request #400 from egoetschalckx/add-country-name
Browse files Browse the repository at this point in the history
add country name
  • Loading branch information
codingricky committed Jul 19, 2019
2 parents d6e647b + 598b00f commit 602b8d2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/com/github/javafaker/Country.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,8 @@ public String currencyCode() {
return faker.fakeValuesService().resolve("country.currency_code", this, faker);
}

public String name() {
return faker.fakeValuesService().resolve("country.name", this, faker);
}

}
5 changes: 5 additions & 0 deletions src/test/java/com/github/javafaker/CountryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,9 @@ public void testCurrency() {
public void testCurrencyCode() {
assertThat(faker.country().currencyCode(), matchesRegularExpression("([\\w-]+ ?)+"));
}

@Test
public void testName() {
assertThat(faker.country().name(), matchesRegularExpression("([\\w-]+ ?)+"));
}
}

0 comments on commit 602b8d2

Please sign in to comment.