Skip to content

Commit

Permalink
Remove SHOW_ON_COUNTER during the cut action
Browse files Browse the repository at this point in the history
  • Loading branch information
nbirillo committed Oct 17, 2024
1 parent 1da359a commit 23d3192
Show file tree
Hide file tree
Showing 14 changed files with 5 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ data object KitchenImpl : Kitchen {
actions += buildAction(ActionType.CUT_ON_COUNTER, vegetable)
val cut = CutVegetable(vegetable.type)
filling += cut
actions += buildAction(ActionType.SHOW_ON_COUNTER, cut)
return cut
}

Expand Down
5 changes: 1 addition & 4 deletions culinaryServer/culinaryServerAddSpices/test/Tests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,7 @@ class Test {
val expectedActions = buildList {
addAll(List(NUMBER_OF_TOMATOES) { Action(ActionType.SHOW_ON_COUNTER, ItemType.FRESH_TOMATO) })
repeat(NUMBER_OF_TOMATOES) {
addAll(listOf(
Action(ActionType.CUT_ON_COUNTER, ItemType.FRESH_TOMATO),
Action(ActionType.SHOW_ON_COUNTER, ItemType.CUT_TOMATO)
))
add(Action(ActionType.CUT_ON_COUNTER, ItemType.FRESH_TOMATO))
}
repeat(NUMBER_OF_TOMATOES) {
addAll(listOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ data object KitchenImpl : Kitchen {
actions += buildAction(ActionType.CUT_ON_COUNTER, vegetable)
val cut = CutVegetable(vegetable.type)
filling += cut
actions += buildAction(ActionType.SHOW_ON_COUNTER, cut)
return cut
}

Expand Down
3 changes: 1 addition & 2 deletions culinaryServer/culinaryServerCookSalad/test/Tests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class Test {
val expectedActions = buildList {
addAll(List(vegetables.size) { ActionType.SHOW_ON_COUNTER })
repeat(vegetables.size) {
addAll(listOf(ActionType.CUT_ON_COUNTER, ActionType.SHOW_ON_COUNTER))
add(ActionType.CUT_ON_COUNTER)
}
}
assert(expectedActions == actions.map{ it.type }) { "The ${cutMethod.name} method should take vegetables and cut them: take each of them from the fridge, and then cut" }
Expand Down Expand Up @@ -174,7 +174,6 @@ class Test {
repeat(NUMBER_OF_TOMATOES) {
addAll(listOf(
Action(ActionType.CUT_ON_COUNTER, ItemType.FRESH_TOMATO),
Action(ActionType.SHOW_ON_COUNTER, ItemType.CUT_TOMATO)
))
}
repeat(NUMBER_OF_TOMATOES) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ data object KitchenImpl : Kitchen {
actions += buildAction(ActionType.CUT_ON_COUNTER, vegetable)
val cut = CutVegetable(vegetable.type)
filling += cut
actions += buildAction(ActionType.SHOW_ON_COUNTER, cut)
return cut
}

Expand Down
9 changes: 2 additions & 7 deletions culinaryServer/culinaryServerCookSmoothie/test/Tests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import org.jetbrains.academy.test.system.core.invokeWithoutArgs
import org.jetbrains.kotlin.course.culinary.converters.buildAction
import org.jetbrains.kotlin.course.culinary.game.actions
import org.jetbrains.kotlin.course.culinary.game.clearActions
import org.jetbrains.kotlin.course.culinary.game.fridge
import org.jetbrains.kotlin.course.culinary.game.kitchen
import org.jetbrains.kotlin.course.culinary.game.recipes.NUMBER_OF_TOMATOES
import org.jetbrains.kotlin.course.culinary.game.recipes.NUM_VEGETABLES_FOR_SALAD
import org.jetbrains.kotlin.course.culinary.implementation.storage.FridgeImpl
Expand Down Expand Up @@ -115,7 +113,7 @@ class Test {
val expectedActions = buildList {
addAll(List(vegetables.size) { ActionType.SHOW_ON_COUNTER })
repeat(vegetables.size) {
addAll(listOf(ActionType.CUT_ON_COUNTER, ActionType.SHOW_ON_COUNTER))
add(ActionType.CUT_ON_COUNTER)
}
}
assert(expectedActions == actions.map{ it.type }) { "The ${cutMethod.name} method should take vegetables and cut them: take each of them from the fridge, and then cut" }
Expand Down Expand Up @@ -213,10 +211,7 @@ class Test {
val expectedActions = buildList {
addAll(List(NUMBER_OF_TOMATOES) { Action(ActionType.SHOW_ON_COUNTER, ItemType.FRESH_TOMATO) })
repeat(NUMBER_OF_TOMATOES) {
addAll(listOf(
Action(ActionType.CUT_ON_COUNTER, ItemType.FRESH_TOMATO),
Action(ActionType.SHOW_ON_COUNTER, ItemType.CUT_TOMATO)
))
add(Action(ActionType.CUT_ON_COUNTER, ItemType.FRESH_TOMATO))
}
repeat(NUMBER_OF_TOMATOES) {
addAll(listOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ data object KitchenImpl : Kitchen {
actions += buildAction(ActionType.CUT_ON_COUNTER, vegetable)
val cut = CutVegetable(vegetable.type)
filling += cut
actions += buildAction(ActionType.SHOW_ON_COUNTER, cut)
return cut
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ data object KitchenImpl : Kitchen {
actions += buildAction(ActionType.CUT_ON_COUNTER, vegetable)
val cut = CutVegetable(vegetable.type)
filling += cut
actions += buildAction(ActionType.SHOW_ON_COUNTER, cut)
return cut
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ data object KitchenImpl : Kitchen {
actions += buildAction(ActionType.CUT_ON_COUNTER, vegetable)
val cut = CutVegetable(vegetable.type)
filling += cut
actions += buildAction(ActionType.SHOW_ON_COUNTER, cut)
return cut
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ data object KitchenImpl : Kitchen {
actions += buildAction(ActionType.CUT_ON_COUNTER, vegetable)
val cut = CutVegetable(vegetable.type)
filling += cut
actions += buildAction(ActionType.SHOW_ON_COUNTER, cut)
return cut
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ data object KitchenImpl : Kitchen {
actions += buildAction(ActionType.CUT_ON_COUNTER, vegetable)
val cut = CutVegetable(vegetable.type)
filling += cut
actions += buildAction(ActionType.SHOW_ON_COUNTER, cut)
return cut
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ data object KitchenImpl : Kitchen {
actions += buildAction(ActionType.CUT_ON_COUNTER, vegetable)
val cut = CutVegetable(vegetable.type)
filling += cut
actions += buildAction(ActionType.SHOW_ON_COUNTER, cut)
return cut
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ data object KitchenImpl : Kitchen {
actions += buildAction(ActionType.CUT_ON_COUNTER, vegetable)
val cut = CutVegetable(vegetable.type)
filling += cut
actions += buildAction(ActionType.SHOW_ON_COUNTER, cut)
return cut
}

Expand Down
5 changes: 1 addition & 4 deletions culinaryServer/culinaryServerTomatoSoup/test/Tests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ class Test {
val expectedActions = buildList {
addAll(List(NUMBER_OF_TOMATOES) { Action(ActionType.SHOW_ON_COUNTER, ItemType.FRESH_TOMATO) })
repeat(NUMBER_OF_TOMATOES) {
addAll(listOf(
Action(ActionType.CUT_ON_COUNTER, ItemType.FRESH_TOMATO),
Action(ActionType.SHOW_ON_COUNTER, ItemType.CUT_TOMATO)
))
add(Action(ActionType.CUT_ON_COUNTER, ItemType.FRESH_TOMATO))
}
repeat(NUMBER_OF_TOMATOES) {
addAll(listOf(
Expand Down

0 comments on commit 23d3192

Please sign in to comment.