Skip to content

Commit 1a592a6

Browse files
authored
Merge pull request #586 from coldexpression/develop
EnglandFootBall Faker
2 parents 4f1dfa9 + 23c1eb2 commit 1a592a6

File tree

7 files changed

+155
-0
lines changed

7 files changed

+155
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ Fakers
8787
* Dune
8888
* Educator
8989
* Esports
90+
* EnglandFootBall
9091
* File
9192
* Finance
9293
* Food
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.github.javafaker;
2+
3+
public class EnglandFootBall {
4+
5+
private final Faker faker;
6+
7+
protected EnglandFootBall(final Faker faker) {
8+
this.faker = faker;
9+
}
10+
11+
public String league() {
12+
return faker.fakeValuesService().resolve("englandfootball.leagues",this,faker);
13+
}
14+
15+
public String team() {
16+
return faker.fakeValuesService().resolve("englandfootball.teams",this,faker);
17+
}
18+
}

src/main/java/com/github/javafaker/Faker.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ public class Faker {
104104
private final Basketball basketball;
105105
private final Barcode barcode;
106106
private final Sip sip;
107+
private final EnglandFootBall englandfootball;
107108

108109
public Faker() {
109110
this(Locale.ENGLISH);
@@ -217,6 +218,7 @@ public Faker(FakeValuesService fakeValuesService, RandomService random) {
217218
this.basketball = new Basketball(this);
218219
this.barcode = new Barcode(this);
219220
this.sip = new Sip(this);
221+
this.englandfootball = new EnglandFootBall(this);
220222
}
221223

222224
/**
@@ -677,6 +679,8 @@ public StarCraft starCraft() {
677679

678680
public Sip sip() { return sip; }
679681

682+
public EnglandFootBall englandfootball() { return englandfootball; }
683+
680684
public String resolve(String key) {
681685
return this.fakeValuesService.resolve(key, this, this);
682686
}

src/main/java/com/github/javafaker/service/files/EnFile.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ public String getPath() {
7474
"elder_scrolls.yml",
7575
"electrical_components.yml",
7676
"esport.yml",
77+
"englandfootball.yml",
7778
"fallout.yml",
7879
"family_guy.yml",
7980
"famous_last_words.yml",
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
en:
2+
faker:
3+
englandfootball:
4+
leagues: [
5+
"PremierLeague",
6+
"EFLChampionship",
7+
"EFLLeagueone",
8+
"EFLLeaguetwo"
9+
]
10+
teams: [
11+
"NewcastileUnited",
12+
"LecesterCityF.C.",
13+
"LiverpoolF.C.",
14+
"LeedsUnitedF.C.",
15+
"ManchesterCityF.C.",
16+
"ManchesterUnitedF.C.",
17+
"BurnleyF.C.",
18+
"Brighton&HoveAlbionF.C.",
19+
"SouthamptonF.C.",
20+
"SheffieldUnitedF.C.",
21+
"ArsenalF.C.",
22+
"AstonVillaF.C.",
23+
"EvertonF.C.",
24+
"WolverhamptonWanderersF.C.",
25+
"WestBromwichAlbionF.C.",
26+
"WestHamUnitedF.C.",
27+
"ChelseaF.C.",
28+
"TottenhamHotspurF.C.",
29+
"CrystalPalaceF.C.",
30+
"FulhamF.C.",
31+
"NorwichCityF.C.",
32+
"NottinghamForestF.C.",
33+
"DerbyCountyF.C.",
34+
"RotherhamUnitedF.C.",
35+
"LutonTownF.C.",
36+
"ReadingF.C.",
37+
"MiddlesbroughF.C.",
38+
"MillwallF.C.",
39+
"BarnsleyF.C.",
40+
"BirminghamCity.F.C.",
41+
"A.F.C.Bournemouth",
42+
"BrentfordF.C.",
43+
"BristolCityF.C.",
44+
"BlackburnRoversF.C.",
45+
"SheffieldWednesdayF.C.",
46+
"SwanseaCityA.F.C.",
47+
"StokeCityF.C.",
48+
"WatfordF.C.",
49+
"WycombeWanderersF.C.",
50+
"CardiffCityF.C.",
51+
"CoventryCity.F.C.",
52+
"QueensParkRangersF.C.",
53+
"PrestonNorthEndF.C.",
54+
"HuddersfieldTownA.F.C.",
55+
"NorthamptonTownF.C.",
56+
"DoncasterRoversF.C.",
57+
"RochdaleA.F.C.",
58+
"LincolnCityF.C.",
59+
"MiltonKeynesDonsF.C.",
60+
"BurtonAlbionF.C.",
61+
"BristolRoversF.C.",
62+
"BlackpoolF.C.",
63+
"SunderlandA.F.C.",
64+
"ShrewsburyTownF.C.",
65+
"SwindonTownF.C.",
66+
"AccringtonStanleyF.C.",
67+
"OxforUnitedF.C.",
68+
"WiganAthleticF.C.",
69+
"AFCWimbledon",
70+
"IpswichTownF.C.",
71+
"GillinghamF.C.",
72+
"CharltonAthleticF.C.",
73+
"CreweAlexandraF.C.",
74+
"PortsmouthF.C.",
75+
"PlymouthArgyleF.C.",
76+
"FleetwoodTownF.C.",
77+
"PeterboroughUnitedF.C.",
78+
"HullCityA.F.C",
79+
"GrimsbyTownF.C.",
80+
"NewportCountyA.F.C.",
81+
"LeytonOrientF.C.",
82+
"MansfieldTownF.C.",
83+
"MorecambeF.C.",
84+
"BarrowA.F.C.",
85+
"BoltonWanderersF.C.",
86+
"BradfordCityA.F.C.",
87+
"SouthendUnitedF.C.",
88+
"SalfordCityF.C.",
89+
"ScunthorpeUnitedF.C.",
90+
"StevenageF.C.",
91+
"ExeterCityF.C.",
92+
"OldhamAthleticA.F.C.",
93+
"WalsallF.C.",
94+
"CheltenhamTownF.C.",
95+
"CarlisleUnitedF.C.",
96+
"CambridgeUnitedF.C.",
97+
"ColchesterUnitedF.C.",
98+
"CrawleyTownF.C.",
99+
"TranmereRoversF.C.",
100+
"ForestGreenRoversF.C.",
101+
"PortValeF.C.",
102+
"HarrogateTownA.F.C."
103+
]
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package com.github.javafaker;
2+
3+
4+
import org.junit.Test;
5+
6+
7+
import static org.hamcrest.Matchers.*;
8+
import static org.junit.Assert.assertThat;
9+
10+
public class EnglandFootBallTest extends AbstractFakerTest{
11+
12+
13+
14+
@Test
15+
public void testLeague() {
16+
String league = faker.englandfootball().league();
17+
assertThat(league, not(isEmptyOrNullString()));
18+
19+
}
20+
21+
@Test
22+
public void testTeam() {
23+
String team = faker.englandfootball().team();
24+
assertThat(team, not(isEmptyOrNullString()));
25+
26+
}
27+
}

src/test/java/com/github/javafaker/integration/FakerIT.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ public void testAllFakerMethodsThatReturnStrings() throws Exception {
174174
testAllMethodsThatReturnStringsActuallyReturnStrings(faker.disease());
175175
testAllMethodsThatReturnStringsActuallyReturnStrings(faker.basketball());
176176
testAllMethodsThatReturnStringsActuallyReturnStrings(faker.barcode());
177+
testAllMethodsThatReturnStringsActuallyReturnStrings(faker.englandfootball());
177178
}
178179

179180
private void testAllMethodsThatReturnStringsActuallyReturnStrings(Object object) throws Exception {

0 commit comments

Comments
 (0)