Skip to content

Commit b17f3ab

Browse files
committed
test(plugin25): test jumping back onto own field with card
1 parent 3ebe8b8 commit b17f3ab

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

plugin2025/src/test/kotlin/sc/plugin2025/MoveTest.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class MoveTest: WordSpec({
2828

2929
state.performMoveDirectly(Advance(2))
3030
state.turn shouldBe 1
31+
state.otherPlayer.position shouldBe 2
3132

3233
state.checkAdvance(2) shouldBe HuIMoveMistake.FIELD_OCCUPIED
3334
state.checkAdvance(3) shouldBe HuIMoveMistake.CARD_NOT_OWNED
@@ -85,18 +86,20 @@ class MoveTest: WordSpec({
8586
state.currentPlayer.addCard(Card.FALL_BACK)
8687
state.checkAdvance(3) shouldBe null
8788

88-
"not allow fallback to start" {
89+
"not allow fallback to startfield" {
8990
state.otherPlayer.position = 1
9091
state.possibleCardMoves(3).shouldBeEmpty()
9192
}
9293

9394
"allow fallback and buy" {
9495
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
9699
state.cloneCurrentPlayer { it.position = 1 }.nextCards() shouldBe Card.values().map { listOf(it) }
97100
state.cloneCurrentPlayer { it.position = 3 }.nextCards() shouldBe Card.values().map { listOf(Card.FALL_BACK, it) }
98101

99-
state.performMoveDirectly(Advance(3, Card.FALL_BACK, Card.EAT_SALAD))
102+
state.performMoveDirectly(Advance(2, Card.FALL_BACK, Card.EAT_SALAD))
100103
state.turn shouldBe 2
101104
state.otherPlayer.getCards() shouldBe listOf(Card.EAT_SALAD)
102105
}

0 commit comments

Comments
 (0)