@@ -28,6 +28,7 @@ class MoveTest: WordSpec({
28
28
29
29
state.performMoveDirectly(Advance (2))
30
30
state.turn shouldBe 1
31
+ state.otherPlayer.position shouldBe 2
31
32
32
33
state.checkAdvance(2) shouldBe HuIMoveMistake .FIELD_OCCUPIED
33
34
state.checkAdvance(3) shouldBe HuIMoveMistake .CARD_NOT_OWNED
@@ -85,18 +86,20 @@ class MoveTest: WordSpec({
85
86
state.currentPlayer.addCard(Card .FALL_BACK )
86
87
state.checkAdvance(3) shouldBe null
87
88
88
- " not allow fallback to start " {
89
+ " not allow fallback to startfield " {
89
90
state.otherPlayer.position = 1
90
91
state.possibleCardMoves(3).shouldBeEmpty()
91
92
}
92
93
93
94
" allow fallback and buy" {
94
95
state.checkAdvance(3) shouldBe null
95
- Advance (3, Card .FALL_BACK ).perform(state.clone()) shouldBe HuIMoveMistake .MUST_BUY_ONE_CARD
96
+ Advance (2, Card .FALL_BACK ).perform(state.clone()) shouldBe HuIMoveMistake .FIELD_OCCUPIED
97
+ state.currentPlayer.position++
98
+ Advance (2, Card .FALL_BACK ).perform(state.clone()) shouldBe HuIMoveMistake .MUST_BUY_ONE_CARD
96
99
state.cloneCurrentPlayer { it.position = 1 }.nextCards() shouldBe Card .values().map { listOf(it) }
97
100
state.cloneCurrentPlayer { it.position = 3 }.nextCards() shouldBe Card .values().map { listOf(Card .FALL_BACK , it) }
98
101
99
- state.performMoveDirectly(Advance (3 , Card .FALL_BACK , Card .EAT_SALAD ))
102
+ state.performMoveDirectly(Advance (2 , Card .FALL_BACK , Card .EAT_SALAD ))
100
103
state.turn shouldBe 2
101
104
state.otherPlayer.getCards() shouldBe listOf(Card .EAT_SALAD )
102
105
}
0 commit comments