MCPcopy Create free account
hub / github.com/DiUS/java-faker / CountryTest

Class CountryTest

src/test/java/com/github/javafaker/CountryTest.java:10–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8import static org.junit.Assert.assertThat;
9
10public class CountryTest extends AbstractFakerTest {
11
12 @Test
13 @Repeat(times=10)
14 public void testFlag() {
15 String flag = faker.country().flag();
16 assertThat(flag, matchesRegularExpression("^http:\\/\\/flags.fmcdn\\.net\\/data\\/flags\\/w580\\/[a-zA-Z0-9_]+\\.png$"));
17 }
18
19
20 @Test
21 public void testCode2() {
22 assertThat(faker.country().countryCode2(), matchesRegularExpression("([a-z]{2})"));
23 }
24
25 @Test
26 public void testCode3() {
27 assertThat(faker.country().countryCode3(), matchesRegularExpression("([a-z]{3})"));
28 }
29
30 @Test
31 public void testCapital() {
32 assertThat(faker.country().capital(), matchesRegularExpression("([\\w'-]+ ?)+"));
33 }
34
35 @Test
36 public void testCurrency() {
37 assertThat(faker.country().currency(), matchesRegularExpression("([A-Za-zÀ-ÿ'’()-]+ ?)+"));
38 }
39
40 @Test
41 public void testCurrencyCode() {
42 assertThat(faker.country().currencyCode(), matchesRegularExpression("([\\w-’í]+ ?)+"));
43 }
44
45 @Test
46 public void testName() {
47 assertThat(faker.country().name(), isStringWithContents());
48 }
49}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected