diff options
Diffstat (limited to 'server/test/command/amd_cassandra_special_command_test.dart')
| -rw-r--r-- | server/test/command/amd_cassandra_special_command_test.dart | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/server/test/command/amd_cassandra_special_command_test.dart b/server/test/command/amd_cassandra_special_command_test.dart new file mode 100644 index 0000000..19fde22 --- /dev/null +++ b/server/test/command/amd_cassandra_special_command_test.dart @@ -0,0 +1,63 @@ +import 'package:test/test.dart'; +import 'package:x_haven_server/core/commands/amd_cassandra_special_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('AMDCassandraSpecialCommand', () { + test('should set cassandraSpecial to true on main deck', () { + AMDCassandraSpecialCommand( + '', + true, + gameState: getIt<GameState>(), + ).execute(); + expect(getIt<GameState>().modifierDeck.cassandraSpecial, isTrue); + checkSaveState(); + }); + + test('should set cassandraSpecial to false on main deck', () { + AMDCassandraSpecialCommand( + '', + true, + gameState: getIt<GameState>(), + ).execute(); + AMDCassandraSpecialCommand( + '', + false, + gameState: getIt<GameState>(), + ).execute(); + expect(getIt<GameState>().modifierDeck.cassandraSpecial, isFalse); + checkSaveState(); + }); + + test('describe when on returns leave-revealed string', () { + final command = AMDCassandraSpecialCommand( + 'Blinkblade', + true, + gameState: getIt<GameState>(), + ); + expect( + command.describe(), + 'Leave revealed cards on top of Blinkblade deck', + ); + }); + + test('describe when off returns turned-off string', () { + final command = AMDCassandraSpecialCommand( + 'Blinkblade', + false, + gameState: getIt<GameState>(), + ); + expect( + command.describe(), + 'Cassandra Special turned off for Blinkblade deck', + ); + }); + }); +} |
