From 5c9db7244a5f2d5e7270fa1bb3de6f76865e6f5b Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sat, 9 May 2026 17:22:16 +0200 Subject: [PATCH] fix: adjusted test --- test/db_tests/aggregates/match_test.dart | 32 ++++++++++++++++-------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/test/db_tests/aggregates/match_test.dart b/test/db_tests/aggregates/match_test.dart index 7f627f7..0c5b1df 100644 --- a/test/db_tests/aggregates/match_test.dart +++ b/test/db_tests/aggregates/match_test.dart @@ -261,28 +261,28 @@ void main() { }); test('getMatchCount() works correctly', () async { - var matchCount = await database.matchDao.getMatchCount(); - expect(matchCount, 0); + var count = await database.matchDao.getMatchCount(); + expect(count, 0); await database.matchDao.addMatch(match: testMatch1); - matchCount = await database.matchDao.getMatchCount(); - expect(matchCount, 1); + count = await database.matchDao.getMatchCount(); + expect(count, 1); await database.matchDao.addMatch(match: testMatch2); - matchCount = await database.matchDao.getMatchCount(); - expect(matchCount, 2); + count = await database.matchDao.getMatchCount(); + expect(count, 2); await database.matchDao.deleteMatch(matchId: testMatch1.id); - matchCount = await database.matchDao.getMatchCount(); - expect(matchCount, 1); + count = await database.matchDao.getMatchCount(); + expect(count, 1); await database.matchDao.deleteMatch(matchId: testMatch2.id); - matchCount = await database.matchDao.getMatchCount(); - expect(matchCount, 0); + count = await database.matchDao.getMatchCount(); + expect(count, 0); }); test('getMatchCountByGame() works correctly', () async { @@ -302,6 +302,18 @@ void main() { gameId: testGame.id, ); expect(count, 2); + + await database.matchDao.deleteMatch(matchId: testMatch1.id); + count = await database.matchDao.getMatchCountByGame( + gameId: testGame.id, + ); + expect(count, 1); + + await database.matchDao.deleteMatch(matchId: testMatch2.id); + count = await database.matchDao.getMatchCountByGame( + gameId: testGame.id, + ); + expect(count, 0); }); test('getMatchCountByGame() returns 0 for non-existent game', () async {