Removed unnecessary id declarations in tests

This commit is contained in:
2025-11-18 20:10:29 +01:00
parent 282841ecf1
commit c0ff2bf677
3 changed files with 16 additions and 29 deletions

View File

@@ -24,21 +24,12 @@ void main() {
), ),
); );
player1 = Player(id: 'p1', name: 'Alice'); player1 = Player(name: 'Alice');
player2 = Player(id: 'p2', name: 'Bob'); player2 = Player(name: 'Bob');
player3 = Player(id: 'p3', name: 'Charlie'); player3 = Player(name: 'Charlie');
player4 = Player(id: 'p4', name: 'Diana'); player4 = Player(name: 'Diana');
testgroup = Group( testgroup = Group(name: 'Test Group', members: [player1, player2, player3]);
id: 'gr1', testgame = Game(name: 'Test Game', group: testgroup, players: [player4]);
name: 'Test Group',
members: [player1, player2, player3],
);
testgame = Game(
id: 'ga1',
name: 'Test Game',
group: testgroup,
players: [player4],
);
}); });
tearDown(() async { tearDown(() async {
await database.close(); await database.close();

View File

@@ -22,15 +22,11 @@ void main() {
), ),
); );
player1 = Player(id: 'p1', name: 'Alice'); player1 = Player(name: 'Alice');
player2 = Player(id: 'p2', name: 'Bob'); player2 = Player(name: 'Bob');
player3 = Player(id: 'p3', name: 'Charlie'); player3 = Player(name: 'Charlie');
player4 = Player(id: 'p4', name: 'Diana'); player4 = Player(name: 'Diana');
testgroup = Group( testgroup = Group(name: 'Test Group', members: [player1, player2, player3]);
id: 'gr1',
name: 'Test Group',
members: [player1, player2, player3],
);
}); });
tearDown(() async { tearDown(() async {
await database.close(); await database.close();
@@ -121,12 +117,12 @@ void main() {
expect(playerAdded, true); expect(playerAdded, true);
final playerAdded2 = await database.playerGroupDao.isPlayerInGroup( final playerNotAdded = !await database.playerGroupDao.isPlayerInGroup(
playerId: 'a', playerId: '',
groupId: testgroup.id, groupId: testgroup.id,
); );
expect(playerAdded2, false); expect(playerNotAdded, true);
expect(playerAdded, true); expect(playerAdded, true);

View File

@@ -17,7 +17,7 @@ void main() {
), ),
); );
testPlayer = Player(id: 'test_id', name: 'Test Player'); testPlayer = Player(name: 'Test Player');
}); });
tearDown(() async { tearDown(() async {
await database.close(); await database.close();
@@ -25,7 +25,7 @@ void main() {
group('player tests', () { group('player tests', () {
test('all players get fetched correctly', () async { 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: testPlayer);
await database.playerDao.addPlayer(player: testPlayer2); await database.playerDao.addPlayer(player: testPlayer2);