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