Skip to content

Commit

Permalink
add country name
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Goetschalckx committed Jul 4, 2019
1 parent 506d072 commit 598b00f
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 598b00f

Please sign in to comment.