blob: fcb47a5ab4b170c4f200fecf8ea1160b0fa6f23b (
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
|
// ignore_for_file: no-empty-block
import 'package:test/test.dart';
import 'package:x_haven_server/core/commands/add_character_command.dart';
import 'package:x_haven_server/core/commands/clear_unlocked_classes_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();
});
setUp(() {});
group('ClearUnlockedClassesCommand', () {
test('should clear unlocked classes', () {
// Arrange
AddCharacterCommand(
"Banner Spear",
"Frosthaven",
"Banny",
1,
).execute(); //test data BS is hidden class
final gameState = getIt<GameState>();
expect(
gameState.unlockedClasses,
isNotEmpty,
reason: "Prerequisite: A class should be unlocked.",
);
final command = ClearUnlockedClassesCommand();
// Act
command.execute();
// Assert
expect(gameState.unlockedClasses, isEmpty);
});
test('describe should return correct string', () {
// Arrange
final command = ClearUnlockedClassesCommand();
// Act & Assert
expect(command.describe(), 'Clear unlocked classes');
});
});
}
|