Skip to content

Commit

Permalink
fix: Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stoerti committed Sep 23, 2024
1 parent b2fef10 commit 688260c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
10 changes: 7 additions & 3 deletions backend/src/test/kotlin/org/quizmania/game/Fixtures.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ val PLAYER_ANSWER_3: GameQuestionId = UUID.randomUUID()

val QUESTION_SET_ID: QuestionSetId = UUID.randomUUID().toString()
val QUESTION_ID_1: QuestionSetId = UUID.randomUUID().toString()

val QUESTION_ID_2: QuestionSetId = UUID.randomUUID().toString()
val NOW: Instant = Instant.now()

class GameCommandFixtures {
companion object {
Expand Down Expand Up @@ -62,7 +64,8 @@ class GameCommandFixtures {
gameId = GAME_UUID,
gameQuestionId = gameQuestionId,
username = username,
answer = answer
answer = answer,
answerTimestamp = NOW
)
}

Expand Down Expand Up @@ -132,7 +135,7 @@ class GameEventFixtures {
gameId = GAME_UUID,
gameQuestionId = gameQuestionId,
gameQuestionNumber = gameQuestionNumber,
questionTimestamp = Instant.now(),
questionTimestamp = NOW,
timeToAnswer = 10000,
question = question,
questionMode = mode,
Expand All @@ -150,7 +153,8 @@ class GameEventFixtures {
gameQuestionId = gameQuestionId,
gamePlayerId = gamePlayerId,
playerAnswerId = playerAnswerId,
answer = answer
answer = answer,
timeToAnswer = 0,
)
}
fun questionAnswerOverridden(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import org.quizmania.game.command.application.domain.GameQuestion
import org.quizmania.game.command.application.domain.PlayerAnswer
import org.quizmania.question.api.EstimateQuestion
import org.quizmania.question.api.FreeInputQuestion
import java.time.Instant
import java.util.*

class GameQuestionTest {
Expand All @@ -26,6 +27,7 @@ class GameQuestionTest {
correctAnswer = "100"
),
GameQuestionMode.COLLECTIVE,
Instant.now(),
mutableListOf(
PlayerAnswer(PLAYER_ANSWER_1, GAME_PLAYER_1, "90"),
PlayerAnswer(PLAYER_ANSWER_2, GAME_PLAYER_2, "98"),
Expand Down Expand Up @@ -66,6 +68,7 @@ class GameQuestionTest {
correctAnswer = correctAnswer
),
GameQuestionMode.COLLECTIVE,
Instant.now(),
mutableListOf(PlayerAnswer(PLAYER_ANSWER_1, GAME_PLAYER_1, playerAnswer)),
)

Expand Down

0 comments on commit 688260c

Please sign in to comment.