fix felix typos :)

This commit is contained in:
gelbeinhalb
2026-01-19 14:57:19 +01:00
parent 715b3debbb
commit 764ce13240
5 changed files with 23 additions and 23 deletions

View File

@@ -99,7 +99,7 @@ class PlayerDao extends DatabaseAccessor<AppDatabase> with _$PlayerDaoMixin {
} }
/// Updates the name of the player with the given [playerId] to [newName]. /// Updates the name of the player with the given [playerId] to [newName].
Future<void> updatePlayername({ Future<void> updatePlayerName({
required String playerId, required String playerId,
required String newName, required String newName,
}) async { }) async {

View File

@@ -145,7 +145,7 @@ void main() {
const newGroupName = 'new group name'; const newGroupName = 'new group name';
await database.groupDao.updateGroupname( await database.groupDao.updateGroupName(
groupId: testGroup1.id, groupId: testGroup1.id,
newName: newGroupName, newName: newGroupName,
); );

View File

@@ -12,7 +12,7 @@ void main() {
late Player testPlayer2; late Player testPlayer2;
late Player testPlayer3; late Player testPlayer3;
late Player testPlayer4; late Player testPlayer4;
late Group testgroup; late Group testGroup;
final fixedDate = DateTime(2025, 19, 11, 00, 11, 23); final fixedDate = DateTime(2025, 19, 11, 00, 11, 23);
final fakeClock = Clock(() => fixedDate); final fakeClock = Clock(() => fixedDate);
@@ -30,7 +30,7 @@ void main() {
testPlayer2 = Player(name: 'Bob'); testPlayer2 = Player(name: 'Bob');
testPlayer3 = Player(name: 'Charlie'); testPlayer3 = Player(name: 'Charlie');
testPlayer4 = Player(name: 'Diana'); testPlayer4 = Player(name: 'Diana');
testgroup = Group( testGroup = Group(
name: 'Test Group', name: 'Test Group',
members: [testPlayer1, testPlayer2, testPlayer3], members: [testPlayer1, testPlayer2, testPlayer3],
); );
@@ -45,22 +45,22 @@ void main() {
/// not nullable /// not nullable
test('Adding a player to a group works correctly', () async { test('Adding a player to a group works correctly', () async {
await database.groupDao.addGroup(group: testgroup); await database.groupDao.addGroup(group: testGroup);
await database.playerDao.addPlayer(player: testPlayer4); await database.playerDao.addPlayer(player: testPlayer4);
await database.playerGroupDao.addPlayerToGroup( await database.playerGroupDao.addPlayerToGroup(
groupId: testgroup.id, groupId: testGroup.id,
player: testPlayer4, player: testPlayer4,
); );
var playerAdded = await database.playerGroupDao.isPlayerInGroup( var playerAdded = await database.playerGroupDao.isPlayerInGroup(
groupId: testgroup.id, groupId: testGroup.id,
playerId: testPlayer4.id, playerId: testPlayer4.id,
); );
expect(playerAdded, true); expect(playerAdded, true);
playerAdded = await database.playerGroupDao.isPlayerInGroup( playerAdded = await database.playerGroupDao.isPlayerInGroup(
groupId: testgroup.id, groupId: testGroup.id,
playerId: '', playerId: '',
); );
@@ -68,35 +68,35 @@ void main() {
}); });
test('Removing player from group works correctly', () async { test('Removing player from group works correctly', () async {
await database.groupDao.addGroup(group: testgroup); await database.groupDao.addGroup(group: testGroup);
final playerToRemove = testgroup.members[0]; final playerToRemove = testGroup.members[0];
final removed = await database.playerGroupDao.removePlayerFromGroup( final removed = await database.playerGroupDao.removePlayerFromGroup(
playerId: playerToRemove.id, playerId: playerToRemove.id,
groupId: testgroup.id, groupId: testGroup.id,
); );
expect(removed, true); expect(removed, true);
final result = await database.groupDao.getGroupById( final result = await database.groupDao.getGroupById(
groupId: testgroup.id, groupId: testGroup.id,
); );
expect(result.members.length, testgroup.members.length - 1); expect(result.members.length, testGroup.members.length - 1);
final playerExists = result.members.any((p) => p.id == playerToRemove.id); final playerExists = result.members.any((p) => p.id == playerToRemove.id);
expect(playerExists, false); expect(playerExists, false);
}); });
test('Retrieving players of a group works correctly', () async { test('Retrieving players of a group works correctly', () async {
await database.groupDao.addGroup(group: testgroup); await database.groupDao.addGroup(group: testGroup);
final players = await database.playerGroupDao.getPlayersOfGroup( final players = await database.playerGroupDao.getPlayersOfGroup(
groupId: testgroup.id, groupId: testGroup.id,
); );
for (int i = 0; i < players.length; i++) { for (int i = 0; i < players.length; i++) {
expect(players[i].id, testgroup.members[i].id); expect(players[i].id, testGroup.members[i].id);
expect(players[i].name, testgroup.members[i].name); expect(players[i].name, testGroup.members[i].name);
expect(players[i].createdAt, testgroup.members[i].createdAt); expect(players[i].createdAt, testGroup.members[i].createdAt);
} }
}); });
}); });

View File

@@ -160,7 +160,7 @@ void main() {
} }
}); });
test('Updating the match players works coreclty', () async { test('Updating the match players works correctly', () async {
await database.matchDao.addMatch(match: testMatchOnlyPlayers); await database.matchDao.addMatch(match: testMatchOnlyPlayers);
final newPlayers = [testPlayer1, testPlayer2, testPlayer4]; final newPlayers = [testPlayer1, testPlayer2, testPlayer4];
@@ -204,7 +204,7 @@ void main() {
}); });
test( test(
'Adding the same player to seperate matches works correctly', 'Adding the same player to separate matches works correctly',
() async { () async {
final playersList = [testPlayer1, testPlayer2, testPlayer3]; final playersList = [testPlayer1, testPlayer2, testPlayer3];
final match1 = Match(name: 'Match 1', players: playersList); final match1 = Match(name: 'Match 1', players: playersList);

View File

@@ -63,7 +63,7 @@ void main() {
final allPlayers = await database.playerDao.getAllPlayers(); final allPlayers = await database.playerDao.getAllPlayers();
expect(allPlayers.length, 4); expect(allPlayers.length, 4);
// Map for connencting fetched players with expected players // Map for connecting fetched players with expected players
final testPlayers = { final testPlayers = {
testPlayer1.id: testPlayer1, testPlayer1.id: testPlayer1,
testPlayer2.id: testPlayer2, testPlayer2.id: testPlayer2,
@@ -115,12 +115,12 @@ void main() {
expect(playerExists, false); expect(playerExists, false);
}); });
test('Updating a player name works correcly', () async { test('Updating a player name works correctly', () async {
await database.playerDao.addPlayer(player: testPlayer1); await database.playerDao.addPlayer(player: testPlayer1);
const newPlayerName = 'new player name'; const newPlayerName = 'new player name';
await database.playerDao.updatePlayername( await database.playerDao.updatePlayerName(
playerId: testPlayer1.id, playerId: testPlayer1.id,
newName: newPlayerName, newName: newPlayerName,
); );