Fixed tests

This commit is contained in:
2025-08-23 18:27:23 +02:00
parent 25274ed914
commit 892d127144
3 changed files with 24 additions and 15 deletions

View File

@@ -8,6 +8,8 @@ void main() {
const testKamikazePlayerIndex = 1;
const testScores = [10, 20, 30];
const testScoreUpdates = [5, 15, 25];
const testRoundId = 'testRoundId';
const testGameId = 'testGameId';
setUp(() {
round = Round(
@@ -32,8 +34,8 @@ void main() {
test('Constructor with null kamikazePlayerIndex', () {
final roundWithoutKamikaze = Round(
roundId: 'testRoundId',
gameId: 'testGameId',
roundId: testRoundId,
gameId: testGameId,
roundNum: testRoundNum,
caboPlayerIndex: testCaboPlayerIndex,
kamikazePlayerIndex: null,
@@ -49,6 +51,8 @@ void main() {
test('toJson() returns correct map', () {
final jsonMap = round.toJson();
expect(jsonMap['roundId'], equals(testRoundId));
expect(jsonMap['gameId'], equals(testGameId));
expect(jsonMap['roundNum'], equals(testRoundNum));
expect(jsonMap['caboPlayerIndex'], equals(testCaboPlayerIndex));
expect(jsonMap['kamikazePlayerIndex'], equals(testKamikazePlayerIndex));
@@ -58,6 +62,8 @@ void main() {
test('fromJson() creates correct Round object', () {
final jsonMap = {
'roundId': testRoundId,
'gameId': testGameId,
'roundNum': testRoundNum,
'caboPlayerIndex': testCaboPlayerIndex,
'kamikazePlayerIndex': testKamikazePlayerIndex,
@@ -76,6 +82,8 @@ void main() {
test('fromJson() with null kamikazePlayerIndex', () {
final jsonMap = {
'roundId': testRoundId,
'gameId': testGameId,
'roundNum': testRoundNum,
'caboPlayerIndex': testCaboPlayerIndex,
'kamikazePlayerIndex': null,