fix formatting
Some checks failed
Pull Request Pipeline / lint (pull_request) Successful in 1m25s
Pull Request Pipeline / test (pull_request) Failing after 36s

This commit is contained in:
gelbeinhalb
2026-02-07 17:40:27 +01:00
parent a12f4eb1c1
commit 278544788e
2 changed files with 23 additions and 35 deletions

View File

@@ -122,19 +122,15 @@ void main() {
} else {
fail('Group is null');
}
if (result.players != null) {
expect(result.players!.length, testMatch1.players!.length);
expect(result.players.length, testMatch1.players.length);
for (int i = 0; i < testMatch1.players!.length; i++) {
expect(result.players![i].id, testMatch1.players![i].id);
expect(result.players![i].name, testMatch1.players![i].name);
expect(
result.players![i].createdAt,
testMatch1.players![i].createdAt,
);
}
} else {
fail('Players is null');
for (int i = 0; i < testMatch1.players.length; i++) {
expect(result.players[i].id, testMatch1.players[i].id);
expect(result.players[i].name, testMatch1.players[i].name);
expect(
result.players[i].createdAt,
testMatch1.players[i].createdAt,
);
}
});
@@ -191,18 +187,14 @@ void main() {
}
// Players-Checks
if (testMatch.players != null) {
expect(match.players!.length, testMatch.players!.length);
for (int i = 0; i < testMatch.players!.length; i++) {
expect(match.players![i].id, testMatch.players![i].id);
expect(match.players![i].name, testMatch.players![i].name);
expect(
match.players![i].createdAt,
testMatch.players![i].createdAt,
);
}
} else {
expect(match.players, null);
expect(match.players.length, testMatch.players.length);
for (int i = 0; i < testMatch.players.length; i++) {
expect(match.players[i].id, testMatch.players[i].id);
expect(match.players[i].name, testMatch.players[i].name);
expect(
match.players[i].createdAt,
testMatch.players[i].createdAt,
);
}
}
});

View File

@@ -140,7 +140,7 @@ void main() {
test('Removing player from match works correctly', () async {
await database.matchDao.addMatch(match: testMatchOnlyPlayers);
final playerToRemove = testMatchOnlyPlayers.players![0];
final playerToRemove = testMatchOnlyPlayers.players[0];
final removed = await database.playerMatchDao.removePlayerFromMatch(
playerId: playerToRemove.id,
@@ -151,9 +151,9 @@ void main() {
final result = await database.matchDao.getMatchById(
matchId: testMatchOnlyPlayers.id,
);
expect(result.players!.length, testMatchOnlyPlayers.players!.length - 1);
expect(result.players.length, testMatchOnlyPlayers.players.length - 1);
final playerExists = result.players!.any(
final playerExists = result.players.any(
(p) => p.id == playerToRemove.id,
);
expect(playerExists, false);
@@ -164,18 +164,14 @@ void main() {
await database.matchDao.addMatch(match: testMatchOnlyPlayers);
final players = await database.playerMatchDao.getPlayersOfMatch(
matchId: testMatchOnlyPlayers.id,
);
if (players == null) {
fail('Players should not be null');
}
) ?? [];
for (int i = 0; i < players.length; i++) {
expect(players[i].id, testMatchOnlyPlayers.players![i].id);
expect(players[i].name, testMatchOnlyPlayers.players![i].name);
expect(players[i].id, testMatchOnlyPlayers.players[i].id);
expect(players[i].name, testMatchOnlyPlayers.players[i].name);
expect(
players[i].createdAt,
testMatchOnlyPlayers.players![i].createdAt,
testMatchOnlyPlayers.players[i].createdAt,
);
}
});