// ignore_for_file: no-magic-number import 'package:test/test.dart'; import 'package:x_haven_server/core/commands/set_difficulty_command.dart'; import 'package:x_haven_server/core/state/game_state.dart'; import 'package:x_haven_server/core/service_locator.dart'; import 'test_helpers.dart'; void main() { setUpAll(() async { await setUpGame(); }); group('SetDifficultyCommand', () { test('should set difficulty to given value', () { final command = SetDifficultyCommand(2, gameState: getIt()); command.execute(); expect(getIt().difficulty, 2); checkSaveState(); }); test('should set difficulty to negative value', () { final command = SetDifficultyCommand(-1, gameState: getIt()); command.execute(); expect(getIt().difficulty, -1); checkSaveState(); }); test('describe should include difficulty level', () { final command = SetDifficultyCommand(3, gameState: getIt()); expect(command.describe(), 'Set difficulty level to 3'); }); }); }