-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for Ancient provider for el_GR locale
- Loading branch information
Showing
1 changed file
with
33 additions
and
2 deletions.
There are no files selected for viewing
35 changes: 33 additions & 2 deletions
35
src/test/java/net/datafaker/providers/base/AncientTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,47 @@ | ||
package net.datafaker.providers.base; | ||
|
||
import org.junit.jupiter.api.AfterAll; | ||
import org.junit.jupiter.api.BeforeAll; | ||
import org.junit.jupiter.api.Nested; | ||
|
||
import java.util.List; | ||
import java.util.Collection; | ||
import java.util.Locale; | ||
|
||
class AncientTest extends BaseFakerTest<BaseFaker> { | ||
|
||
@Override | ||
protected Collection<TestSpec> providerListTest() { | ||
Ancient ancient = faker.ancient(); | ||
return List.of(TestSpec.of(ancient::god, "ancient.god"), | ||
return getProviderListTests(ancient); | ||
} | ||
|
||
@Nested | ||
class AncientInGreekTest extends BaseFakerTest<BaseFaker> { | ||
|
||
@BeforeAll | ||
void setup() { | ||
this.setFaker(new BaseFaker(new Locale("el", "GR"))); | ||
} | ||
|
||
@AfterAll | ||
void reset() { | ||
this.setFaker(this.getFaker()); | ||
} | ||
|
||
@Override | ||
protected Collection<TestSpec> providerListTest() { | ||
Ancient ancient = faker.ancient(); | ||
return getProviderListTests(ancient); | ||
} | ||
} | ||
|
||
private Collection<TestSpec> getProviderListTests(Ancient ancient) { | ||
return List.of( | ||
TestSpec.of(ancient::god, "ancient.god"), | ||
TestSpec.of(ancient::primordial, "ancient.primordial"), | ||
TestSpec.of(ancient::titan, "ancient.titan"), | ||
TestSpec.of(ancient::hero, "ancient.hero")); | ||
TestSpec.of(ancient::hero, "ancient.hero") | ||
); | ||
} | ||
} |