// ignore_for_file: no-magic-number import 'package:test/test.dart'; import 'package:x_haven_server/core/commands/add_special_loot_card_command.dart'; import 'package:x_haven_server/core/commands/remove__special_loot_card_command.dart'; import 'package:x_haven_server/core/commands/set_campaign_command.dart'; import 'package:x_haven_server/core/commands/set_scenario_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(); }); setUp(() { SetCampaignCommand('Frosthaven').execute(); SetScenarioCommand( '#0 Howling in the Snow', false, gameState: getIt(), ).execute(); }); group('RemoveSpecialLootCardCommand', () { test('should remove special card 1418 from draw pile', () { AddSpecialLootCardCommand(1418, gameState: getIt()).execute(); final lootDeck = getIt().lootDeck; expect(lootDeck.hasCard1418, isTrue); RemoveSpecialLootCardCommand( 1418, gameState: getIt(), ).execute(); expect(lootDeck.hasCard1418, isFalse); checkSaveState(); }); test('should remove special card 1419 from draw pile', () { AddSpecialLootCardCommand(1419, gameState: getIt()).execute(); final lootDeck = getIt().lootDeck; expect(lootDeck.hasCard1419, isTrue); RemoveSpecialLootCardCommand( 1419, gameState: getIt(), ).execute(); expect(lootDeck.hasCard1419, isFalse); checkSaveState(); }); test('should do nothing for unknown card nr', () { final lootDeck = getIt().lootDeck; final countBefore = lootDeck.drawPileSize; RemoveSpecialLootCardCommand( 9999, gameState: getIt(), ).execute(); expect(lootDeck.drawPileSize, countBefore); }); test('describe includes the card number', () { final command = RemoveSpecialLootCardCommand( 1418, gameState: getIt(), ); expect(command.describe(), 'Remove Special loot card 1418'); }); }); }