diff options
Diffstat (limited to 'server/test/command/set_campaign_command_test.dart')
| -rw-r--r-- | server/test/command/set_campaign_command_test.dart | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/server/test/command/set_campaign_command_test.dart b/server/test/command/set_campaign_command_test.dart new file mode 100644 index 0000000..1f214ed --- /dev/null +++ b/server/test/command/set_campaign_command_test.dart @@ -0,0 +1,33 @@ +import 'package:test/test.dart'; +import 'package:x_haven_server/core/commands/set_campaign_command.dart'; +import 'package:x_haven_server/core/service_locator.dart'; +import 'package:x_haven_server/core/state/game_state.dart'; + +import 'test_helpers.dart'; + +void main() { + setUpAll(() async { + await setUpGame(); + }); + + group('SetCampaignCommand', () { + test('should set campaign to Frosthaven', () { + final command = SetCampaignCommand('Frosthaven'); + command.execute(); + expect(getIt<GameState>().currentCampaign, 'Frosthaven'); + checkSaveState(); + }); + + test('should set campaign to Jaws of the Lion', () { + final command = SetCampaignCommand('Jaws of the Lion'); + command.execute(); + expect(getIt<GameState>().currentCampaign, 'Jaws of the Lion'); + checkSaveState(); + }); + + test('describe should return correct string', () { + final command = SetCampaignCommand('Frosthaven'); + expect(command.describe(), 'Set Frosthaven campaign'); + }); + }); +} |
