Refactoring
This commit is contained in:
@@ -211,7 +211,7 @@ void main() {
|
||||
const newName = 'New name';
|
||||
await database.groupDao.updateGroupName(
|
||||
groupId: testGroup1.id,
|
||||
newName: newName,
|
||||
name: newName,
|
||||
);
|
||||
|
||||
final result = await database.groupDao.getGroupById(
|
||||
@@ -223,7 +223,7 @@ void main() {
|
||||
test('updateGroupName() returns false for non-existent group', () async {
|
||||
final updated = await database.groupDao.updateGroupName(
|
||||
groupId: 'non-existent-id',
|
||||
newName: 'New name',
|
||||
name: 'New name',
|
||||
);
|
||||
expect(updated, isFalse);
|
||||
});
|
||||
@@ -234,7 +234,7 @@ void main() {
|
||||
const newDescription = 'New description';
|
||||
final updated = await database.groupDao.updateGroupDescription(
|
||||
groupId: testGroup1.id,
|
||||
newDescription: newDescription,
|
||||
description: newDescription,
|
||||
);
|
||||
expect(updated, isTrue);
|
||||
|
||||
@@ -249,7 +249,7 @@ void main() {
|
||||
() async {
|
||||
final updated = await database.groupDao.updateGroupDescription(
|
||||
groupId: 'non-existent-id',
|
||||
newDescription: 'New description',
|
||||
description: 'New description',
|
||||
);
|
||||
expect(updated, isFalse);
|
||||
},
|
||||
@@ -262,11 +262,11 @@ void main() {
|
||||
|
||||
await database.groupDao.updateGroupName(
|
||||
groupId: testGroup1.id,
|
||||
newName: newName,
|
||||
name: newName,
|
||||
);
|
||||
await database.groupDao.updateGroupDescription(
|
||||
groupId: testGroup1.id,
|
||||
newDescription: newDescription,
|
||||
description: newDescription,
|
||||
);
|
||||
|
||||
final updatedGroup = await database.groupDao.getGroupById(
|
||||
|
||||
@@ -268,7 +268,7 @@ void main() {
|
||||
const newName = 'New name';
|
||||
await database.matchDao.updateMatchName(
|
||||
matchId: testMatch1.id,
|
||||
newName: newName,
|
||||
name: newName,
|
||||
);
|
||||
|
||||
final fetchedMatch = await database.matchDao.getMatchById(
|
||||
@@ -280,7 +280,7 @@ void main() {
|
||||
test('updateMatchName() does nothing for non-existent match', () async {
|
||||
final updated = await database.matchDao.updateMatchName(
|
||||
matchId: 'non-existing-id',
|
||||
newName: 'New Name',
|
||||
name: 'New Name',
|
||||
);
|
||||
expect(updated, isFalse);
|
||||
|
||||
@@ -294,7 +294,7 @@ void main() {
|
||||
|
||||
await database.matchDao.updateMatchGroup(
|
||||
matchId: testMatch1.id,
|
||||
newGroupId: testGroup2.id,
|
||||
groupId: testGroup2.id,
|
||||
);
|
||||
|
||||
final fetchedMatch = await database.matchDao.getMatchById(
|
||||
@@ -306,7 +306,7 @@ void main() {
|
||||
test('updateMatchGroup() does nothing for non-existent match', () async {
|
||||
final updated = await database.matchDao.updateMatchGroup(
|
||||
matchId: 'non-existing-id',
|
||||
newGroupId: 'group-id',
|
||||
groupId: 'group-id',
|
||||
);
|
||||
expect(updated, isFalse);
|
||||
|
||||
@@ -362,7 +362,7 @@ void main() {
|
||||
const newName = 'New name';
|
||||
await database.matchDao.updateMatchName(
|
||||
matchId: testMatch1.id,
|
||||
newName: newName,
|
||||
name: newName,
|
||||
);
|
||||
|
||||
final fetchedMatch = await database.matchDao.getMatchById(
|
||||
|
||||
@@ -263,7 +263,7 @@ void main() {
|
||||
const newName = 'New name';
|
||||
await database.teamDao.updateTeamName(
|
||||
teamId: testTeam1.id,
|
||||
newName: newName,
|
||||
name: newName,
|
||||
);
|
||||
|
||||
fetchedTeam = await database.teamDao.getTeamById(teamId: testTeam1.id);
|
||||
@@ -273,7 +273,7 @@ void main() {
|
||||
test('updateTeamName() does nothing for non-existent team', () async {
|
||||
final updated = await database.teamDao.updateTeamName(
|
||||
teamId: 'non-existing-id',
|
||||
newName: 'New Name',
|
||||
name: 'New Name',
|
||||
);
|
||||
expect(updated, isFalse);
|
||||
|
||||
|
||||
@@ -197,7 +197,7 @@ void main() {
|
||||
|
||||
final updated = await database.gameDao.updateGameName(
|
||||
gameId: testGame1.id,
|
||||
newName: newName,
|
||||
name: newName,
|
||||
);
|
||||
expect(updated, isTrue);
|
||||
|
||||
@@ -210,7 +210,7 @@ void main() {
|
||||
test('updateGameName() does nothing for non-existent game', () async {
|
||||
final updated = await database.gameDao.updateGameName(
|
||||
gameId: 'non-existent-id',
|
||||
newName: 'New name',
|
||||
name: 'New name',
|
||||
);
|
||||
expect(updated, isFalse);
|
||||
|
||||
@@ -224,7 +224,7 @@ void main() {
|
||||
|
||||
final updated = await database.gameDao.updateGameRuleset(
|
||||
gameId: testGame1.id,
|
||||
newRuleset: ruleset,
|
||||
ruleset: ruleset,
|
||||
);
|
||||
expect(updated, isTrue);
|
||||
|
||||
@@ -237,7 +237,7 @@ void main() {
|
||||
test('updateGameRuleset() does nothing for non-existent game', () async {
|
||||
final updated = await database.gameDao.updateGameRuleset(
|
||||
gameId: 'non-existent-id',
|
||||
newRuleset: Ruleset.lowestScore,
|
||||
ruleset: Ruleset.lowestScore,
|
||||
);
|
||||
expect(updated, isFalse);
|
||||
|
||||
@@ -251,7 +251,7 @@ void main() {
|
||||
|
||||
final updated = await database.gameDao.updateGameDescription(
|
||||
gameId: testGame1.id,
|
||||
newDescription: newDescription,
|
||||
description: newDescription,
|
||||
);
|
||||
expect(updated, isTrue);
|
||||
|
||||
@@ -266,7 +266,7 @@ void main() {
|
||||
() async {
|
||||
final updated = await database.gameDao.updateGameDescription(
|
||||
gameId: 'non-existent-id',
|
||||
newDescription: 'New description',
|
||||
description: 'New description',
|
||||
);
|
||||
expect(updated, isFalse);
|
||||
|
||||
@@ -280,7 +280,7 @@ void main() {
|
||||
|
||||
await database.gameDao.updateGameColor(
|
||||
gameId: testGame1.id,
|
||||
newColor: GameColor.green,
|
||||
color: GameColor.green,
|
||||
);
|
||||
|
||||
final updatedGame = await database.gameDao.getGameById(
|
||||
@@ -292,7 +292,7 @@ void main() {
|
||||
test('updateGameColor() does nothing for non-existent game', () async {
|
||||
final updated = await database.gameDao.updateGameColor(
|
||||
gameId: 'non-existent-id',
|
||||
newColor: GameColor.green,
|
||||
color: GameColor.green,
|
||||
);
|
||||
expect(updated, isFalse);
|
||||
|
||||
@@ -306,7 +306,7 @@ void main() {
|
||||
|
||||
final updated = await database.gameDao.updateGameIcon(
|
||||
gameId: testGame1.id,
|
||||
newIcon: newIcon,
|
||||
icon: newIcon,
|
||||
);
|
||||
expect(updated, isTrue);
|
||||
|
||||
@@ -319,7 +319,7 @@ void main() {
|
||||
test('updateGameIcon() does nothing for non-existent game', () async {
|
||||
final updated = await database.gameDao.updateGameIcon(
|
||||
gameId: 'non-existent-id',
|
||||
newIcon: 'New icon',
|
||||
icon: 'New icon',
|
||||
);
|
||||
expect(updated, isFalse);
|
||||
|
||||
@@ -333,19 +333,19 @@ void main() {
|
||||
const newName = 'New name';
|
||||
await database.gameDao.updateGameName(
|
||||
gameId: testGame1.id,
|
||||
newName: newName,
|
||||
name: newName,
|
||||
);
|
||||
|
||||
const newGameColor = GameColor.teal;
|
||||
await database.gameDao.updateGameColor(
|
||||
gameId: testGame1.id,
|
||||
newColor: newGameColor,
|
||||
color: newGameColor,
|
||||
);
|
||||
|
||||
const newDescription = 'New description';
|
||||
await database.gameDao.updateGameDescription(
|
||||
gameId: testGame1.id,
|
||||
newDescription: newDescription,
|
||||
description: newDescription,
|
||||
);
|
||||
|
||||
final updatedGame = await database.gameDao.getGameById(
|
||||
|
||||
@@ -213,7 +213,7 @@ void main() {
|
||||
|
||||
await database.playerDao.updatePlayerName(
|
||||
playerId: testPlayer1.id,
|
||||
newName: newName,
|
||||
name: newName,
|
||||
);
|
||||
|
||||
final player = await database.playerDao.getPlayerById(
|
||||
@@ -225,7 +225,7 @@ void main() {
|
||||
test('updatePlayerName() does nothing for non-existent player', () async {
|
||||
final updated = await database.playerDao.updatePlayerName(
|
||||
playerId: 'non-existent-id',
|
||||
newName: 'New name',
|
||||
name: 'New name',
|
||||
);
|
||||
expect(updated, isFalse);
|
||||
|
||||
@@ -240,7 +240,7 @@ void main() {
|
||||
|
||||
final updated = await database.playerDao.updatePlayerDescription(
|
||||
playerId: testPlayer1.id,
|
||||
newDescription: newDescription,
|
||||
description: newDescription,
|
||||
);
|
||||
expect(updated, isTrue);
|
||||
|
||||
@@ -255,7 +255,7 @@ void main() {
|
||||
() async {
|
||||
final updated = await database.playerDao.updatePlayerDescription(
|
||||
playerId: 'non-existent-id',
|
||||
newDescription: 'New description',
|
||||
description: 'New description',
|
||||
);
|
||||
expect(updated, isFalse);
|
||||
|
||||
@@ -269,7 +269,7 @@ void main() {
|
||||
|
||||
await database.playerDao.updatePlayerName(
|
||||
playerId: testPlayer1.id,
|
||||
newName: 'First Update',
|
||||
name: 'First Update',
|
||||
);
|
||||
|
||||
var fetchedPlayer = await database.playerDao.getPlayerById(
|
||||
@@ -279,7 +279,7 @@ void main() {
|
||||
|
||||
await database.playerDao.updatePlayerName(
|
||||
playerId: testPlayer1.id,
|
||||
newName: 'Second Update',
|
||||
name: 'Second Update',
|
||||
);
|
||||
|
||||
fetchedPlayer = await database.playerDao.getPlayerById(
|
||||
@@ -289,7 +289,7 @@ void main() {
|
||||
|
||||
await database.playerDao.updatePlayerDescription(
|
||||
playerId: testPlayer1.id,
|
||||
newDescription: 'Third Update',
|
||||
description: 'Third Update',
|
||||
);
|
||||
|
||||
fetchedPlayer = await database.playerDao.getPlayerById(
|
||||
|
||||
@@ -253,7 +253,7 @@ void main() {
|
||||
|
||||
await database.playerMatchDao.updateMatchPlayers(
|
||||
matchId: testMatch1.id,
|
||||
newPlayer: newPlayers,
|
||||
player: newPlayers,
|
||||
);
|
||||
|
||||
final updatedPlayers = await database.playerMatchDao.getPlayersOfMatch(
|
||||
@@ -337,7 +337,7 @@ void main() {
|
||||
final newPlayersList = [testPlayer1, testPlayer2];
|
||||
await database.playerMatchDao.updateMatchPlayers(
|
||||
matchId: testMatch1.id,
|
||||
newPlayer: newPlayersList,
|
||||
player: newPlayersList,
|
||||
);
|
||||
|
||||
matchPlayers = await database.matchDao.getMatchById(
|
||||
@@ -356,7 +356,7 @@ void main() {
|
||||
|
||||
final updated = await database.playerMatchDao.updateMatchPlayers(
|
||||
matchId: testMatch1.id,
|
||||
newPlayer: originalPlayers,
|
||||
player: originalPlayers,
|
||||
);
|
||||
expect(updated, isFalse);
|
||||
|
||||
@@ -375,7 +375,7 @@ void main() {
|
||||
await database.matchDao.addMatch(match: testMatch1);
|
||||
final updated = await database.playerMatchDao.updateMatchPlayers(
|
||||
matchId: testMatch1.id,
|
||||
newPlayer: [],
|
||||
player: [],
|
||||
);
|
||||
|
||||
expect(updated, isFalse);
|
||||
|
||||
@@ -435,7 +435,7 @@ void main() {
|
||||
final updated = await database.scoreEntryDao.updateScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
newEntry: newEntry,
|
||||
entry: newEntry,
|
||||
);
|
||||
|
||||
expect(updated, isTrue);
|
||||
@@ -455,7 +455,7 @@ void main() {
|
||||
final updated = await database.scoreEntryDao.updateScore(
|
||||
playerId: testPlayer1.id,
|
||||
matchId: testMatch1.id,
|
||||
newEntry: entryRound1,
|
||||
entry: entryRound1,
|
||||
);
|
||||
|
||||
expect(updated, isFalse);
|
||||
|
||||
Reference in New Issue
Block a user