fix: adjusted test
All checks were successful
Pull Request Pipeline / test (pull_request) Successful in 48s
Pull Request Pipeline / lint (pull_request) Successful in 50s

This commit is contained in:
2026-05-09 17:22:16 +02:00
parent fbb83aaf7b
commit 5c9db7244a

View File

@@ -261,28 +261,28 @@ void main() {
}); });
test('getMatchCount() works correctly', () async { test('getMatchCount() works correctly', () async {
var matchCount = await database.matchDao.getMatchCount(); var count = await database.matchDao.getMatchCount();
expect(matchCount, 0); expect(count, 0);
await database.matchDao.addMatch(match: testMatch1); await database.matchDao.addMatch(match: testMatch1);
matchCount = await database.matchDao.getMatchCount(); count = await database.matchDao.getMatchCount();
expect(matchCount, 1); expect(count, 1);
await database.matchDao.addMatch(match: testMatch2); await database.matchDao.addMatch(match: testMatch2);
matchCount = await database.matchDao.getMatchCount(); count = await database.matchDao.getMatchCount();
expect(matchCount, 2); expect(count, 2);
await database.matchDao.deleteMatch(matchId: testMatch1.id); await database.matchDao.deleteMatch(matchId: testMatch1.id);
matchCount = await database.matchDao.getMatchCount(); count = await database.matchDao.getMatchCount();
expect(matchCount, 1); expect(count, 1);
await database.matchDao.deleteMatch(matchId: testMatch2.id); await database.matchDao.deleteMatch(matchId: testMatch2.id);
matchCount = await database.matchDao.getMatchCount(); count = await database.matchDao.getMatchCount();
expect(matchCount, 0); expect(count, 0);
}); });
test('getMatchCountByGame() works correctly', () async { test('getMatchCountByGame() works correctly', () async {
@@ -302,6 +302,18 @@ void main() {
gameId: testGame.id, gameId: testGame.id,
); );
expect(count, 2); 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 { test('getMatchCountByGame() returns 0 for non-existent game', () async {