Added missing methods
All checks were successful
Pull Request Pipeline / test (pull_request) Successful in 2m6s
Pull Request Pipeline / lint (pull_request) Successful in 2m7s

This commit is contained in:
2025-11-21 13:12:36 +01:00
parent 32f3f68da9
commit e15f5d163d
3 changed files with 52 additions and 22 deletions

View File

@@ -120,7 +120,21 @@ void main() {
expect(playerExists, false);
});
//TODO: test getPlayersOfGame()
test('Retrieving players of a game works correctly', () async {});
test('Retrieving players of a game works correctly', () async {
await database.gameDao.addGame(game: testgameWithPlayers);
final players = await database.playerGameDao.getPlayersOfGame(
gameId: testgameWithPlayers.id,
);
if (players == null) {
fail('Players should not be null');
}
for (int i = 0; i < players.length; i++) {
expect(players[i].id, testgameWithPlayers.players![i].id);
expect(players[i].name, testgameWithPlayers.players![i].name);
expect(players[i].createdAt, testgameWithPlayers.players![i].createdAt);
}
});
});
}