import 'package:test/test.dart'; import 'package:x_haven_server/core/commands/set_auto_level_adjust_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('SetAutoLevelAdjustCommand', () { test('should turn auto level adjust on', () { final command = SetAutoLevelAdjustCommand( true, gameState: getIt(), ); command.execute(); expect(getIt().autoScenarioLevel, isTrue); checkSaveState(); }); test('should turn auto level adjust off', () { SetAutoLevelAdjustCommand(true, gameState: getIt()).execute(); final command = SetAutoLevelAdjustCommand( false, gameState: getIt(), ); command.execute(); expect(getIt().autoScenarioLevel, isFalse); checkSaveState(); }); test('describe should say "on" when enabled', () { final command = SetAutoLevelAdjustCommand( true, gameState: getIt(), ); expect(command.describe(), 'Turn automatic level update on'); }); test('describe should say "off" when disabled', () { final command = SetAutoLevelAdjustCommand( false, gameState: getIt(), ); expect(command.describe(), 'Turn automatic level update off'); }); }); }