Skip to content

Commit 8171a5f

Browse files
committed
Add tests for Ancient provider for el_GR locale
1 parent d97f15c commit 8171a5f

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed
Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,47 @@
11
package net.datafaker.providers.base;
22

3+
import org.junit.jupiter.api.AfterAll;
4+
import org.junit.jupiter.api.BeforeAll;
5+
import org.junit.jupiter.api.Nested;
6+
37
import java.util.List;
48
import java.util.Collection;
9+
import java.util.Locale;
510

611
class AncientTest extends BaseFakerTest<BaseFaker> {
712

813
@Override
914
protected Collection<TestSpec> providerListTest() {
1015
Ancient ancient = faker.ancient();
11-
return List.of(TestSpec.of(ancient::god, "ancient.god"),
16+
return getProviderListTests(ancient);
17+
}
18+
19+
@Nested
20+
class AncientInGreekTest extends BaseFakerTest<BaseFaker> {
21+
22+
@BeforeAll
23+
void setup() {
24+
this.setFaker(new BaseFaker(new Locale("el", "GR")));
25+
}
26+
27+
@AfterAll
28+
void reset() {
29+
this.setFaker(this.getFaker());
30+
}
31+
32+
@Override
33+
protected Collection<TestSpec> providerListTest() {
34+
Ancient ancient = faker.ancient();
35+
return getProviderListTests(ancient);
36+
}
37+
}
38+
39+
private Collection<TestSpec> getProviderListTests(Ancient ancient) {
40+
return List.of(
41+
TestSpec.of(ancient::god, "ancient.god"),
1242
TestSpec.of(ancient::primordial, "ancient.primordial"),
1343
TestSpec.of(ancient::titan, "ancient.titan"),
14-
TestSpec.of(ancient::hero, "ancient.hero"));
44+
TestSpec.of(ancient::hero, "ancient.hero")
45+
);
1546
}
1647
}

0 commit comments

Comments
 (0)