add food fakers

Add dish(), fruit(), vegetable(), and sushi()
This commit is contained in:
Eric Goetschalckx
2019-08-09 09:59:21 -04:00
parent 506d072988
commit e55d87f6fa
2 changed files with 36 additions and 0 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);
@@ -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("[A-Za-z1-9- ]+"));
}
@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}"));