Skip to content

Commit

Permalink
Add tests for Job provider for el_GR locale
Browse files Browse the repository at this point in the history
  • Loading branch information
gvrettos committed Oct 27, 2024
1 parent 7c0bb4a commit e10eb76
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/test/java/net/datafaker/providers/base/JobTest.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
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 JobTest extends BaseFakerTest<BaseFaker> {

Expand All @@ -13,4 +18,27 @@ protected Collection<TestSpec> providerListTest() {
TestSpec.of(job::position, "job.position"),
TestSpec.of(job::keySkills, "job.key_skills", "(?:[A-Za-z-]+ ?){1,3}"));
}

@Nested
class JobInGreekTest 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() {
Job job = faker.job();
return List.of(TestSpec.of(job::field, "job.field"),
TestSpec.of(job::seniority, "job.seniority"),
TestSpec.of(job::position, "job.position"),
TestSpec.of(job::keySkills, "job.key_skills", "(?:\\p{L}+ ?){1,3}"));
}
}
}

0 comments on commit e10eb76

Please sign in to comment.