Merge pull request #415 from egoetschalckx/add-food-fakers

add food fakers
This commit is contained in:
Ricky Yim
2019-08-16 21:26:30 +10:00
committed by GitHub
3 changed files with 37 additions and 1 deletions
@@ -16,6 +16,22 @@ public class Food {
return faker.fakeValuesService().resolve("food.spices", this, faker);
}
public String dish() {
return faker.fakeValuesService().resolve("food.dish", this, faker);
}
public String fruit() {
return faker.fakeValuesService().resolve("food.fruits", this, faker);
}
public String vegetable() {
return faker.fakeValuesService().resolve("food.vegetables", this, faker);
}
public String sushi() {
return faker.fakeValuesService().resolve("food.sushi", this, faker);
}
public String measurement() {
return faker.fakeValuesService().resolve("food.measurement_sizes", this, faker) +
" " + faker.fakeValuesService().resolve("food.measurements", this, faker);
+1 -1
View File
@@ -27,4 +27,4 @@ en:
descriptor: [Lead, Senior, Direct, Corporate, Dynamic, Future, Product, National, Regional, District, Central, Global, Customer, Investor, Dynamic, International, Legacy, Forward, Internal, Human, Chief, Principal]
level: [Solutions, Program, Brand, Security, Research, Marketing, Directives, Implementation, Integration, Functionality, Response, Paradigm, Tactics, Identity, Markets, Group, Division, Applications, Optimization, Operations, Infrastructure, Intranet, Communications, Web, Branding, Quality, Assurance, Mobility, Accounts, Data, Creative, Configuration, Accountability, Interactions, Factors, Usability, Metrics]
job: [Supervisor, Associate, Executive, Liaison, Officer, Manager, Engineer, Specialist, Director, Coordinator, Administrator, Architect, Analyst, Designer, Planner, Orchestrator, Technician, Developer, Producer, Consultant, Assistant, Facilitator, Agent, Representative, Strategist]
blood_group: [O, O+, A-, A+, B-, B+, AB-, AB+]
blood_group: [O-, O+, A-, A+, B-, B+, AB-, AB+]
@@ -17,6 +17,26 @@ public class FoodTest extends AbstractFakerTest {
assertThat(faker.food().spice(), matchesRegularExpression("[A-Za-z1-9- ]+"));
}
@Test
public void dish() {
assertThat(faker.food().dish(), matchesRegularExpression("\\P{Cc}+"));
}
@Test
public void fruit() {
assertThat(faker.food().fruit(), matchesRegularExpression("[A-Za-z1-9- ]+"));
}
@Test
public void vegetable() {
assertThat(faker.food().vegetable(), matchesRegularExpression("[A-Za-z1-9- ]+"));
}
@Test
public void sushi() {
assertThat(faker.food().sushi(), matchesRegularExpression("[A-Za-z1-9- ]+"));
}
@Test
public void measurement() {
assertThat(faker.food().measurement(), matchesRegularExpression("[A-Za-z1-9/ ]+{2}"));