Skip to content

Commit c59f78c

Browse files
committed
test(server): adjust GameRoomTest
1 parent cd284c0 commit c59f78c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

server/src/test/java/sc/server/gaming/GameRoomTest.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,16 @@ val minimalReplay = """
4949
<player team="ONE"/>
5050
<score cause="REGULAR" reason="Game terminated">
5151
<part>0</part>
52+
<part>0</part>
53+
<part>2</part>
5254
</score>
5355
</entry>
5456
<entry>
5557
<player team="TWO"/>
5658
<score cause="REGULAR" reason="Game terminated">
5759
<part>0</part>
60+
<part>1</part>
61+
<part>2</part>
5862
</score>
5963
</entry>
6064
</scores>
@@ -77,7 +81,7 @@ class GameRoomTest: WordSpec({
7781
manager.joinOrCreateGame(client, TestPlugin.TEST_PLUGIN_UUID).playerCount shouldBe 2
7882
}
7983
"return correct scores on game over" {
80-
val playersScores = room.game.players.associateWith { PlayerScore(ScoreCause.REGULAR, "Game terminated", 0) }
84+
val playersScores = room.game.players.associateWith { PlayerScore(ScoreCause.REGULAR, "Game terminated", 0, it.team.index, 2) }
8185
room.onGameOver(playersScores)
8286
room.result.isRegular shouldBe true
8387
room.result.scores shouldContainExactly playersScores

server/src/test/java/sc/server/plugins/TestGameState.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ data class TestGameState(
1313
override val currentTeam: Team
1414
get() = Team.values()[turn % Team.values().size]
1515

16+
@Transient
1617
override val isOver = false
1718

1819
override fun getPointsForTeam(team: ITeam): IntArray = intArrayOf(currentTeam.index, turn)

0 commit comments

Comments
 (0)