File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -15,20 +15,28 @@ class PokemonMock: Pokemon {
1515 var isFlyingWasCalled: Bool?
1616 var evolveSuccessHandlerWasCalled: Bool?
1717
18+ var eatFoodWasCalledTimes = 0
19+ var drinkWasCalledTimes = 0
20+ var isFlyingWasCalledTimes = 0
21+ var evolveSuccessHandlerWasCalledTimes = 0
22+
1823 var isFlyingShouldReturn: Bool!
1924
2025 func eat(food: String) {
2126 eatFood = food
2227 eatFoodWasCalled = true
28+ eatFoodWasCalledTimes += 1
2329 }
2430
2531 func drink(_ water: String) {
2632 drinkWater = water
2733 drinkWasCalled = true
34+ drinkWasCalledTimes += 1
2835 }
2936
3037 func isFlying() -> Bool {
3138 isFlyingWasCalled = true
39+ isFlyingWasCalledTimes += 1
3240 return isFlyingShouldReturn
3341 }
3442
@@ -40,6 +48,7 @@ class PokemonMock: Pokemon {
4048 evolveFailureHandlerDidReturn = failureHandler(evolveFailureHandlerParam0)
4149 }
4250 evolveSuccessHandlerWasCalled = true
51+ evolveSuccessHandlerWasCalledTimes += 1
4352 }
4453
4554}
You can’t perform that action at this time.
0 commit comments