Skip to content

Commit

Permalink
more type safety
Browse files Browse the repository at this point in the history
  • Loading branch information
alyssaruth committed Feb 26, 2024
1 parent 5637826 commit 70ff29e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/test/kotlin/dartzee/screen/game/GameTestFactory.kt
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,12 @@ fun makeX01GamePanel(
)
.apply { testInit(currentPlayerId) }

fun makeX01GamePanel(pt: IWrappedParticipant, gameParams: String = DEFAULT_X01_CONFIG.toJson()) =
GamePanelX01(FakeDartsScreen(), insertGame(gameType = GameType.X01, gameParams = gameParams), 1)
fun makeX01GamePanel(pt: IWrappedParticipant, gameParams: X01Config = DEFAULT_X01_CONFIG) =
GamePanelX01(
FakeDartsScreen(),
insertGame(gameType = GameType.X01, gameParams = gameParams.toJson()),
1
)
.apply { testInit(pt) }

fun makeRoundTheClockGamePanel(playerId: String = randomGuid()) =
Expand Down
2 changes: 1 addition & 1 deletion src/test/kotlin/dartzee/screen/game/TestGamePanelX01.kt
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class TestGamePanelX01 : AbstractTest() {
fun `Should correctly update such bad luck achievement for a team`() {
val (p1, p2) = preparePlayers(2)
val team = makeTeam(p1, p2)
val panel = makeX01GamePanel(team, gameParams = X01Config(101, FinishType.Doubles).toJson())
val panel = makeX01GamePanel(team, gameParams = X01Config(101, FinishType.Doubles))
val gameId = panel.gameEntity.rowId

panel.addCompletedRound(
Expand Down

0 comments on commit 70ff29e

Please sign in to comment.