summaryrefslogtreecommitdiff
path: root/server/test/command/corrosive_spew_command_test.dart
blob: d47acf83035b979066837751bc2938978a626597 (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
import 'package:test/test.dart';
import 'package:x_haven_server/core/commands/corrosive_spew_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('CorrosiveSpewCommand', () {
    test('should set corrosiveSpew to true on main modifier deck', () {
      // CorrosiveSpew targets "Ruinmaw" which falls through to the main deck
      expect(getIt<GameState>().modifierDeck.corrosiveSpew, isFalse);

      CorrosiveSpewCommand(gameState: getIt<GameState>()).execute();

      expect(getIt<GameState>().modifierDeck.corrosiveSpew, isTrue);
      checkSaveState();
    });

    test('describe returns correct string', () {
      expect(
        CorrosiveSpewCommand(gameState: getIt<GameState>()).describe(),
        'Corrosive Spew',
      );
    });
  });
}