Skip to content

Commit 85ed057

Browse files
Add an ice-cream specification (#1698)
* add an ice-cream specification
1 parent 0183910 commit 85ed057

5 files changed

Lines changed: 248 additions & 0 deletions

File tree

src/main/java/net/datafaker/providers/food/FoodProviders.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ default Food food() {
2323
return getProvider(Food.class, Food::new);
2424
}
2525

26+
default IceCream iceCream() {
27+
return getProvider(IceCream.class, IceCream::new);
28+
}
29+
2630
default Tea tea() {
2731
return getProvider(Tea.class, Tea::new);
2832
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package net.datafaker.providers.food;
2+
3+
import net.datafaker.providers.base.AbstractProvider;
4+
5+
/**
6+
* @since 2.5.3
7+
*/
8+
public class IceCream extends AbstractProvider<FoodProviders> {
9+
10+
protected IceCream(FoodProviders faker) {
11+
super(faker);
12+
}
13+
14+
public String flavor() {
15+
return resolve("ice_cream.flavor");
16+
}
17+
18+
public String shape() {
19+
return resolve("ice_cream.shape");
20+
}
21+
22+
public String color() {
23+
return resolve("ice_cream.color");
24+
}
25+
}

src/main/java/net/datafaker/service/files/EnFile.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ public String getPath() {
144144
"house.yml",
145145
"how_i_met_your_mother.yml",
146146
"how_to_train_your_dragon.yml",
147+
"ice_cream.yml",
147148
"id_number.yml",
148149
"industry_segments.yml",
149150
"internet.yml",
Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
en:
2+
faker:
3+
ice_cream:
4+
flavor:
5+
- "Vanilla"
6+
- "Chocolate"
7+
- "Strawberry"
8+
- "Mint Chocolate Chip"
9+
- "Cookies and Cream"
10+
- "Butter Pecan"
11+
- "Rocky Road"
12+
- "Neapolitan (vanilla, chocolate, strawberry)"
13+
- "Mango"
14+
- "Blueberry"
15+
- "Raspberry"
16+
- "Banana"
17+
- "Pineapple"
18+
- "Lemon"
19+
- "Passion Fruit"
20+
- "Cherry"
21+
- "Mixed Berry"
22+
- "Almond"
23+
- "Pistachio"
24+
- "Hazelnut"
25+
- "Peanut Butter"
26+
- "Macadamia"
27+
- "Cookie Dough"
28+
- "Brownie Batter"
29+
- "Caramel Swirl"
30+
- "Fudge Ripple"
31+
- "Marshmallow"
32+
- "Toffee"
33+
- "Dark Chocolate"
34+
- "White Chocolate"
35+
- "Chocolate Fudge"
36+
- "Chocolate Hazelnut"
37+
- "Coffee"
38+
- "Mocha"
39+
- "Espresso"
40+
- "Matcha Green Tea"
41+
- "Chai"
42+
- "Hot Chocolate"
43+
- "Lavender"
44+
- "Rose"
45+
- "Earl Grey"
46+
- "Honey"
47+
- "Basil"
48+
- "Lemon Thyme"
49+
- "Olive Oil"
50+
- "Balsamic Strawberry"
51+
- "Cheese (Cheddar, Mascarpone)"
52+
- "Bacon"
53+
- "Wasabi"
54+
- "Sweet Corn"
55+
- "Black Sesame"
56+
- "Charcoal"
57+
- "Pumpkin Spice"
58+
- "Eggnog"
59+
- "Gingerbread"
60+
- "Peppermint"
61+
- "Cranberry"
62+
- "Chocolate Chili"
63+
- "Mango Coconut"
64+
- "Pistachio Rose"
65+
- "Salted Caramel Pretzel"
66+
- "Blueberry Cheesecake"
67+
shape:
68+
- "Round scoop"
69+
- "Double scoop"
70+
- "Triple scoop"
71+
- "Mini scoop"
72+
- "Standard cone"
73+
- "Sugar cone"
74+
- "Waffle cone"
75+
- "Chocolate-dipped cone"
76+
- "Rectangular bar"
77+
- "Oval bar"
78+
- "Mini bar"
79+
- "Coated bar"
80+
- "Swirl soft serve"
81+
- "Twist soft serve"
82+
- "Cup soft serve"
83+
- "Animal shapes"
84+
- "Heart shape"
85+
- "Star shape"
86+
- "Flower shape"
87+
- "Geometric shape"
88+
- "Ice cream sandwich"
89+
- "Cup / bowl"
90+
- "Dome / hemisphere"
91+
- "Cylinder / log"
92+
- "Rolled ice cream"
93+
- "Ice cream cake slice"
94+
- "Popsicle"
95+
- "Layered parfait"
96+
- "Layered cone"
97+
- "Cone with topping swirl"
98+
- "Mini cone"
99+
- "Cone with multiple flavors"
100+
- "Ice cream taco"
101+
- "Ice cream cone tower"
102+
- "Ice cream in chocolate shell"
103+
- "Ice cream sphere in mold"
104+
- "Ice cream bite cubes"
105+
- "Ice cream spiral roll"
106+
- "Ice cream flower mold"
107+
- "Ice cream layered disc"
108+
- "Ice cream layered cube"
109+
- "Ice cream stick with chocolate coating"
110+
- "Ice cream stick with nuts"
111+
- "Ice cream stick with sprinkles"
112+
- "Ice cream shot glass"
113+
- "Ice cream tart"
114+
- "Ice cream mini dome"
115+
- "Ice cream mini lo"
116+
color:
117+
- "White"
118+
- "Cream"
119+
- "Beige"
120+
- "Light brown"
121+
- "Brown"
122+
- "Dark brown"
123+
- "Black"
124+
- "Pink"
125+
- "Light pink"
126+
- "Hot pink"
127+
- "Red"
128+
- "Dark red"
129+
- "Orange"
130+
- "Light orange"
131+
- "Yellow"
132+
- "Light yellow"
133+
- "Golden"
134+
- "Pale green"
135+
- "Green"
136+
- "Dark green"
137+
- "Mint green"
138+
- "Blue"
139+
- "Light blue"
140+
- "Dark blue"
141+
- "Sky blue"
142+
- "Purple"
143+
- "Lavender"
144+
- "Lilac"
145+
- "Magenta"
146+
- "Turquoise"
147+
- "Teal"
148+
- "Peach"
149+
- "Coral"
150+
- "Chocolate brown"
151+
- "Caramel"
152+
- "Honey"
153+
- "Grey"
154+
- "Silver"
155+
- "Bronze"
156+
- "Maroon"
157+
- "Wine"
158+
- "Indigo"
159+
- "Cyan"
160+
- "Aqua"
161+
- "Olive"
162+
- "Mustard"
163+
- "Beige-pink"
164+
- "Pastel yellow"
165+
- "Pastel blue"
166+
- "Pastel green"
167+
- "Pastel purple"
168+
- "Neon pink"
169+
- "Neon green"
170+
- "Neon yellow"
171+
- "Neon orange"
172+
- "Rainbow"
173+
- "Multi-color swirl"
174+
- "White with chocolate chips"
175+
- "White with fruit bits"
176+
- "Brown with caramel swirl"
177+
- "Dark brown with nuts"
178+
- "Pink with sprinkles"
179+
- "Yellow with mango bits"
180+
- "Green with mint chips"
181+
- "Purple with blueberry swirl"
182+
- "Blue with candy pieces"
183+
- "Red with strawberry bits"
184+
- "Orange with orange zest"
185+
- "Light purple with lavender"
186+
- "White with chocolate drizzle"
187+
- "Pink with strawberry swirl"
188+
- "Brown with fudge ripple"
189+
- "Beige with cookie pieces"
190+
- "Light green with pistachio pieces"
191+
- "Yellow with lemon zest"
192+
- "Multi-fruit swirl"
193+
- "Marble effect"
194+
- "Ombre pastel"
195+
- "Shimmer pearl"
196+
- "Glittered colors"
197+
- "Neon swirl"
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package net.datafaker.providers.foods;
2+
3+
import net.datafaker.providers.food.IceCream;
4+
5+
import java.util.Collection;
6+
import java.util.List;
7+
8+
public class IceCreamTest extends FoodFakerTest {
9+
10+
private final IceCream iceCream = getFaker().iceCream();
11+
12+
@Override
13+
protected Collection<TestSpec> providerListTest() {
14+
return List.of(
15+
TestSpec.of(iceCream::flavor, "ice_cream.flavor"),
16+
TestSpec.of(iceCream::shape, "ice_cream.shape"),
17+
TestSpec.of(iceCream::color, "ice_cream.color")
18+
);
19+
}
20+
21+
}

0 commit comments

Comments
 (0)