Formatting
This commit is contained in:
@@ -8,6 +8,7 @@ import 'package:tallee/data/models/game.dart';
|
||||
import 'package:tallee/data/models/group.dart';
|
||||
import 'package:tallee/data/models/match.dart';
|
||||
import 'package:tallee/data/models/player.dart';
|
||||
import 'package:tallee/data/models/score_entry.dart';
|
||||
|
||||
void main() {
|
||||
late AppDatabase database;
|
||||
@@ -62,24 +63,25 @@ void main() {
|
||||
name: 'First Test Match',
|
||||
game: testGame,
|
||||
group: testGroup1,
|
||||
players: [testPlayer4, testPlayer5]
|
||||
players: [testPlayer4, testPlayer5],
|
||||
scores: {testPlayer4.id: ScoreEntry(score: 1)},
|
||||
);
|
||||
testMatch2 = Match(
|
||||
name: 'Second Test Match',
|
||||
game: testGame,
|
||||
group: testGroup2,
|
||||
players: [testPlayer1, testPlayer2, testPlayer3]
|
||||
players: [testPlayer1, testPlayer2, testPlayer3],
|
||||
);
|
||||
testMatchOnlyPlayers = Match(
|
||||
name: 'Test Match with Players',
|
||||
game: testGame,
|
||||
players: [testPlayer1, testPlayer2, testPlayer3]
|
||||
players: [testPlayer1, testPlayer2, testPlayer3],
|
||||
);
|
||||
testMatchOnlyGroup = Match(
|
||||
name: 'Test Match with Group',
|
||||
game: testGame,
|
||||
group: testGroup2,
|
||||
players: testGroup2.members
|
||||
players: testGroup2.members,
|
||||
);
|
||||
});
|
||||
await database.playerDao.addPlayersAsList(
|
||||
|
||||
@@ -59,12 +59,12 @@ void main() {
|
||||
name: 'Test Match with Group',
|
||||
game: testGame,
|
||||
players: testGroup.members,
|
||||
group: testGroup
|
||||
group: testGroup,
|
||||
);
|
||||
testMatchOnlyPlayers = Match(
|
||||
name: 'Test Match with Players',
|
||||
game: testGame,
|
||||
players: [testPlayer4, testPlayer5, testPlayer6]
|
||||
players: [testPlayer4, testPlayer5, testPlayer6],
|
||||
);
|
||||
testTeam1 = Team(name: 'Team Alpha', members: [testPlayer1, testPlayer2]);
|
||||
testTeam2 = Team(name: 'Team Beta', members: [testPlayer3, testPlayer4]);
|
||||
@@ -396,7 +396,6 @@ void main() {
|
||||
matchId: testMatchOnlyGroup.id,
|
||||
teamId: testTeam1.id,
|
||||
);
|
||||
|
||||
expect(playersInTeam.length, 2);
|
||||
final playerIds = playersInTeam.map((p) => p.id).toSet();
|
||||
expect(playerIds.contains(testPlayer1.id), true);
|
||||
@@ -545,6 +544,7 @@ void main() {
|
||||
matchId: testMatchOnlyGroup.id,
|
||||
teamId: testTeam1.id,
|
||||
);
|
||||
|
||||
expect(playersInTeam1.length, 2);
|
||||
final team1Ids = playersInTeam1.map((p) => p.id).toSet();
|
||||
expect(team1Ids.contains(testPlayer1.id), true);
|
||||
@@ -566,12 +566,12 @@ void main() {
|
||||
final match1 = Match(
|
||||
name: 'Match 1',
|
||||
game: testGame,
|
||||
players: playersList
|
||||
players: playersList,
|
||||
);
|
||||
final match2 = Match(
|
||||
name: 'Match 2',
|
||||
game: testGame,
|
||||
players: playersList
|
||||
players: playersList,
|
||||
);
|
||||
|
||||
await Future.wait([
|
||||
|
||||
Reference in New Issue
Block a user