import 'package:test/test.dart'; import 'package:x_haven_server/core/commands/add_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(() { getIt().clearList(); // A scenario is needed to initialize the loot deck SetCampaignCommand("Frosthaven").execute(); SetScenarioCommand( '#0 Howling in the Snow', false, gameState: getIt(), ).execute(); }); group('AddLootCardCommand', () { test('should add a specified loot card to the deck', () { // Arrange final command = AddLootCardCommand( 'lumber', gameState: getIt(), ); final lootDeck = getIt().lootDeck; final initialCardCount = lootDeck.drawPileSize; // Act command.execute(); // Assert expect(lootDeck.drawPileSize, initialCardCount + 1); checkSaveState(); }); test('describe should return the correct string', () { // Arrange final command = AddLootCardCommand( 'hides', gameState: getIt(), ); // Act & Assert expect(command.describe(), 'Add hides Loot Card'); }); }); }