-
Notifications
You must be signed in to change notification settings - Fork 240
David Ogar #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
David Ogar #70
Changes from all commits
f292ca1
8862cf1
7e14815
e4b3f28
7eecee7
4812c26
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -152,6 +152,7 @@ Providers | |
| * Music | ||
| * Name | ||
| * Nation | ||
| * Nigeria | ||
| * Number | ||
| * Options | ||
| * Overwatch | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| package net.datafaker; | ||
|
|
||
| import java.nio.file.Paths; | ||
| import java.util.Locale; | ||
|
|
||
| public class Nigeria { | ||
| private static final String KEY = "nigeria"; | ||
| private final Faker faker; | ||
|
|
||
| protected Nigeria(Faker faker) { | ||
| this.faker = faker; | ||
| faker.fakeValuesService().addPath(Locale.ENGLISH, Paths.get("src/main/resources/en/nigeria.yml")); | ||
| } | ||
|
|
||
| public String places() { | ||
| return faker.fakeValuesService().resolve("nigeria.places", this, faker); | ||
| } | ||
|
|
||
| public String name() { | ||
| return faker.fakeValuesService().resolve("nigeria.name", this, faker); | ||
| } | ||
|
|
||
| public String food() { | ||
| return faker.fakeValuesService().resolve("nigeria.food", this, faker); | ||
| } | ||
|
|
||
| public String schools() { | ||
| return faker.fakeValuesService().resolve("nigeria.schools", this, faker); | ||
| } | ||
|
|
||
| public String celebrities(){ | ||
| return faker.fakeValuesService().resolve("nigeria.celebrities", this, faker); | ||
| } | ||
| } | ||
|
|
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| en: | ||
| faker: | ||
| nigeria: | ||
| places: ["Lagos", "Warri", "Enugu", "Abuja", "Calabar", "Ogoja", "Ogun", "Uyo", "Abia", "Illorin", "Ediba", "Ikot-ekpene", "Abak", "Itu", "Yala", "Sokoto", "Kaduna", "Kano", "kastina"] | ||
| name: ["Bayo", "Akpan", "Itunu", "Kevwe", "Oteri", "Ogun", "Imaobong", "Okon", "Uwem", "Eze", "Lovina", "Rekpene", "Uduak", "Ada", "Abasifreke", "Odachi", "Bello", "Dangote", "Buhari"] | ||
| food: ["Rice", "Bean", "Edikan-Ikong", "Banga-soup", "Ewedu and Amala", "Afang", "Oha-soup", "Atama", "Bitter-leaf soup", "Garri", "Kuli-Kuli"] | ||
| schools: ["FUPRE", "UNI-UYO", "UNICAL", "UNIPORT", "UNIABUJA", "DELSU", "MADONNA", "CRUTECH", "UNILAG", "UNIBEN", "AKSU", "UNN", "EBSU", "COVENANT", "LANDMARK"] | ||
| celebrities: ["Davido", "Wizkid", "Burnaboy", "Skibii", "Adekunle Gold", "Nse-Ikpe Etim", "The Lady Motara", "HackSultan", "David Hundeyi", "Tunde", "El-rufai", "Goodluck Jonathan", "Buhari", "Obasanjo"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,18 +9,15 @@ | |
| public class AustraliaTest extends AbstractFakerTest { | ||
|
|
||
| @Test | ||
| public void locations() { | ||
| assertThat(faker.australia().locations(), not(is(emptyOrNullString()))); | ||
| public void locations() { assertThat(faker.australia().locations(), not(is(emptyOrNullString()))); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Misformatted
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I made the corresponding format changes locally, please check my last commit to see if it's corrected. Apologies. |
||
| } | ||
|
|
||
| @Test | ||
| public void animals() { | ||
| assertThat(faker.australia().animals(), not(is(emptyOrNullString()))); | ||
| public void animals() { assertThat(faker.australia().animals(), not(is(emptyOrNullString()))); | ||
| } | ||
|
|
||
| @Test | ||
| public void states() { | ||
| assertThat(faker.australia().states(), not(is(emptyOrNullString()))); | ||
| public void states() { assertThat(faker.australia().states(), not(is(emptyOrNullString()))); | ||
| } | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| package net.datafaker; | ||
|
|
||
| import org.junit.jupiter.api.Test; | ||
|
|
||
| import static org.hamcrest.MatcherAssert.assertThat; | ||
| import static org.hamcrest.Matchers.*; | ||
|
|
||
|
|
||
| class NigeriaTest extends AbstractFakerTest{ | ||
|
|
||
| @Test | ||
| public void places() { | ||
| assertThat(faker.nigeria().places(), not(is(emptyOrNullString()))); | ||
| } | ||
|
|
||
|
|
||
| @Test | ||
| void food() { | ||
| assertThat(faker.nigeria().food(), not(is(emptyOrNullString()))); | ||
| } | ||
|
|
||
| @Test | ||
| void names() { | ||
| assertThat(faker.nigeria().name(), not(is(emptyOrNullString()))); | ||
| } | ||
|
|
||
| @Test | ||
| void schools() { | ||
| assertThat(faker.nigeria().celebrities(), not(is(emptyOrNullString()))); | ||
| } | ||
|
|
||
| @Test | ||
| void celebrities() { | ||
| assertThat(faker.nigeria().celebrities(), not(is(emptyOrNullString()))); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bodiam @The-True-Hooha I know this PR has already been merged, but this location is still wrong. I guess we need to come up with a test that actually prevents building a JAR whenever this shows up, because the test will succeed but the actual JAR will not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks for letting me know, I even added an extra test to Faker It for this. No worries, I'll fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fixed, I removed this code, I already registered the yml file in the central spot.