diff options
Diffstat (limited to 'server/test/command/amd_reveal_command_test.dart')
| -rw-r--r-- | server/test/command/amd_reveal_command_test.dart | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/server/test/command/amd_reveal_command_test.dart b/server/test/command/amd_reveal_command_test.dart new file mode 100644 index 0000000..98fdb8d --- /dev/null +++ b/server/test/command/amd_reveal_command_test.dart @@ -0,0 +1,50 @@ +// ignore_for_file: no-magic-number + +import 'package:test/test.dart'; +import 'package:x_haven_server/core/commands/amd_reveal_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('AMDRevealCommand', () { + test('should set revealedCount on the main modifier deck', () { + final command = AMDRevealCommand( + amount: 2, + name: 'Monsters', + gameState: getIt<GameState>(), + ); + command.execute(); + expect(getIt<GameState>().modifierDeck.revealedCount, 2); + checkSaveState(); + }); + + test('should set revealedCount to zero when amount is 0', () { + AMDRevealCommand( + amount: 3, + name: 'Monsters', + gameState: getIt<GameState>(), + ).execute(); + AMDRevealCommand( + amount: 0, + name: 'Monsters', + gameState: getIt<GameState>(), + ).execute(); + expect(getIt<GameState>().modifierDeck.revealedCount, 0); + }); + + test('describe should include the amount', () { + final command = AMDRevealCommand( + amount: 3, + name: 'Monsters', + gameState: getIt<GameState>(), + ); + expect(command.describe(), 'Reveal 3 modifier cards'); + }); + }); +} |
