Skip to content

Commit 1cf646f

Browse files
committed
test(plugin): rename game test
1 parent 16b555b commit 1cf646f

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

plugin/src/test/sc/plugin2021/GameTest.kt

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,24 @@ package sc.plugin2021
22

33
import io.kotlintest.shouldBe
44
import io.kotlintest.specs.StringSpec
5+
import sc.plugin2020.util.Constants
6+
import sc.shared.PlayerScore
7+
import sc.shared.ScoreCause
58

69
class GameTest: StringSpec({
7-
"Start a game" {
10+
"Game starting and stopping works" {
11+
Color.BLUE.team
812
val game = Game()
9-
val playerOne = game.onPlayerJoined()
10-
val playerTwo = game.onPlayerJoined()
13+
val state = game.gameState
14+
game.onPlayerJoined() shouldBe Team.ONE
15+
game.onPlayerJoined() shouldBe Team.TWO
1116

12-
playerOne.color shouldBe Team.ONE
13-
playerTwo.color shouldBe Team.TWO
1417
game.start()
18+
game.onAction(state.currentPlayer, PassMove(state.currentColor))
19+
game.onAction(state.currentPlayer, PassMove(state.currentColor))
20+
game.onAction(state.currentPlayer, PassMove(state.currentColor))
21+
game.onAction(state.currentPlayer, PassMove(state.currentColor))
22+
23+
game.playerScores shouldBe List(2) { PlayerScore(ScoreCause.REGULAR, "", Constants.DRAW_SCORE, -178) }
1524
}
1625
})

0 commit comments

Comments
 (0)