getAllGames returnt nicht alle Attribute von der game Klasse #45

Merged
flixcoo merged 20 commits from bug/37-getallgames-returnt-nicht-alle-attribute-von-der-game-klasse into development 2025-11-22 15:22:11 +00:00
Showing only changes of commit bef812502c - Show all commits

View File

@@ -119,52 +119,47 @@ void main() {
}; };
for (final game in allGames) { for (final game in allGames) {
final expectedGame = testGames[game.id]!; final testGame = testGames[game.id]!;
// Game-Checks // Game-Checks
expect(game.id, expectedGame.id); expect(game.id, testGame.id);
expect(game.name, expectedGame.name); expect(game.name, testGame.name);
expect(game.createdAt, expectedGame.createdAt); expect(game.createdAt, testGame.createdAt);
expect(game.winner, expectedGame.winner); expect(game.winner, testGame.winner);
// Group-Checks // Group-Checks
if (expectedGame.group != null) { if (testGame.group != null) {
expect(game.group!.id, expectedGame.group!.id); expect(game.group!.id, testGame.group!.id);
expect(game.group!.name, expectedGame.group!.name); expect(game.group!.name, testGame.group!.name);
expect(game.group!.createdAt, expectedGame.group!.createdAt); expect(game.group!.createdAt, testGame.group!.createdAt);
// Group Members-Checks // Group Members-Checks
expect( expect(game.group!.members.length, testGame.group!.members.length);
game.group!.members.length, for (int i = 0; i < testGame.group!.members.length; i++) {
expectedGame.group!.members.length, expect(game.group!.members[i].id, testGame.group!.members[i].id);
);
for (int i = 0; i < expectedGame.group!.members.length; i++) {
expect(
game.group!.members[i].id,
expectedGame.group!.members[i].id,
);
expect( expect(
game.group!.members[i].name, game.group!.members[i].name,
expectedGame.group!.members[i].name, testGame.group!.members[i].name,
); );
expect( expect(
game.group!.members[i].createdAt, game.group!.members[i].createdAt,
expectedGame.group!.members[i].createdAt, testGame.group!.members[i].createdAt,
); );
} }
} else {
expect(game.group, null);
} }
// Players-Checks // Players-Checks
if (expectedGame.players != null) { if (testGame.players != null) {
expect(game.players!.length, expectedGame.players!.length); expect(game.players!.length, testGame.players!.length);
for (int i = 0; i < expectedGame.players!.length; i++) { for (int i = 0; i < testGame.players!.length; i++) {
expect(game.players![i].id, expectedGame.players![i].id); expect(game.players![i].id, testGame.players![i].id);
expect(game.players![i].name, expectedGame.players![i].name); expect(game.players![i].name, testGame.players![i].name);
expect( expect(game.players![i].createdAt, testGame.players![i].createdAt);
game.players![i].createdAt,
expectedGame.players![i].createdAt,
);
} }
} else {
expect(game.players, null);
} }
} }
}); });