summaryrefslogtreecommitdiff
path: root/server/test/command/amd_cassandra_special_command_test.dart
blob: 19fde2296570e3a24670b66ea9425936365e38c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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',
      );
    });
  });
}