From c0ff2bf6777d90393ae8941dbd2291c4cf5aae4d Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Tue, 18 Nov 2025 20:10:29 +0100 Subject: [PATCH] Removed unnecessary id declarations in tests --- test/db_tests/game_test.dart | 21 ++++++--------------- test/db_tests/group_test.dart | 20 ++++++++------------ test/db_tests/player_test.dart | 4 ++-- 3 files changed, 16 insertions(+), 29 deletions(-) diff --git a/test/db_tests/game_test.dart b/test/db_tests/game_test.dart index bee3ff8..29b0233 100644 --- a/test/db_tests/game_test.dart +++ b/test/db_tests/game_test.dart @@ -24,21 +24,12 @@ void main() { ), ); - player1 = Player(id: 'p1', name: 'Alice'); - player2 = Player(id: 'p2', name: 'Bob'); - player3 = Player(id: 'p3', name: 'Charlie'); - player4 = Player(id: 'p4', name: 'Diana'); - testgroup = Group( - id: 'gr1', - name: 'Test Group', - members: [player1, player2, player3], - ); - testgame = Game( - id: 'ga1', - name: 'Test Game', - group: testgroup, - players: [player4], - ); + player1 = Player(name: 'Alice'); + player2 = Player(name: 'Bob'); + player3 = Player(name: 'Charlie'); + player4 = Player(name: 'Diana'); + testgroup = Group(name: 'Test Group', members: [player1, player2, player3]); + testgame = Game(name: 'Test Game', group: testgroup, players: [player4]); }); tearDown(() async { await database.close(); diff --git a/test/db_tests/group_test.dart b/test/db_tests/group_test.dart index d8d6ce2..3a9d8ca 100644 --- a/test/db_tests/group_test.dart +++ b/test/db_tests/group_test.dart @@ -22,15 +22,11 @@ void main() { ), ); - player1 = Player(id: 'p1', name: 'Alice'); - player2 = Player(id: 'p2', name: 'Bob'); - player3 = Player(id: 'p3', name: 'Charlie'); - player4 = Player(id: 'p4', name: 'Diana'); - testgroup = Group( - id: 'gr1', - name: 'Test Group', - members: [player1, player2, player3], - ); + player1 = Player(name: 'Alice'); + player2 = Player(name: 'Bob'); + player3 = Player(name: 'Charlie'); + player4 = Player(name: 'Diana'); + testgroup = Group(name: 'Test Group', members: [player1, player2, player3]); }); tearDown(() async { await database.close(); @@ -121,12 +117,12 @@ void main() { expect(playerAdded, true); - final playerAdded2 = await database.playerGroupDao.isPlayerInGroup( - playerId: 'a', + final playerNotAdded = !await database.playerGroupDao.isPlayerInGroup( + playerId: '', groupId: testgroup.id, ); - expect(playerAdded2, false); + expect(playerNotAdded, true); expect(playerAdded, true); diff --git a/test/db_tests/player_test.dart b/test/db_tests/player_test.dart index 5258c66..91f4acb 100644 --- a/test/db_tests/player_test.dart +++ b/test/db_tests/player_test.dart @@ -17,7 +17,7 @@ void main() { ), ); - testPlayer = Player(id: 'test_id', name: 'Test Player'); + testPlayer = Player(name: 'Test Player'); }); tearDown(() async { await database.close(); @@ -25,7 +25,7 @@ void main() { group('player tests', () { test('all players get fetched correctly', () async { - final testPlayer2 = Player(id: 'gr2', name: 'Second Group'); + final testPlayer2 = Player(name: 'Second Group'); await database.playerDao.addPlayer(player: testPlayer); await database.playerDao.addPlayer(player: testPlayer2);