|
|
@ -140,19 +140,16 @@ void main() {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
final flameTester = FlameTester(
|
|
|
|
|
|
|
|
() => PinballTestGame(assets: assets),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
final debugModeFlameTester = FlameTester(
|
|
|
|
|
|
|
|
() => DebugPinballTestGame(assets: assets),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final flameBlocTester = FlameBlocTester<PinballGame, GameBloc>(
|
|
|
|
|
|
|
|
gameBuilder: () => PinballTestGame(assets: assets),
|
|
|
|
|
|
|
|
blocBuilder: () => gameBloc,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
group('PinballGame', () {
|
|
|
|
group('PinballGame', () {
|
|
|
|
|
|
|
|
final flameTester = FlameTester(
|
|
|
|
|
|
|
|
() => PinballTestGame(assets: assets),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final flameBlocTester = FlameBlocTester<PinballGame, GameBloc>(
|
|
|
|
|
|
|
|
gameBuilder: () => PinballTestGame(assets: assets),
|
|
|
|
|
|
|
|
blocBuilder: () => gameBloc,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
group('components', () {
|
|
|
|
group('components', () {
|
|
|
|
// TODO(alestiago): tests that Blueprints get added once the Blueprint
|
|
|
|
// TODO(alestiago): tests that Blueprints get added once the Blueprint
|
|
|
|
// class is removed.
|
|
|
|
// class is removed.
|
|
|
@ -247,6 +244,8 @@ void main() {
|
|
|
|
final newState = _MockGameState();
|
|
|
|
final newState = _MockGameState();
|
|
|
|
when(() => newState.isGameOver).thenReturn(false);
|
|
|
|
when(() => newState.isGameOver).thenReturn(false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await game.ready();
|
|
|
|
|
|
|
|
|
|
|
|
expect(
|
|
|
|
expect(
|
|
|
|
game.descendants().whereType<ControlledBall>().length,
|
|
|
|
game.descendants().whereType<ControlledBall>().length,
|
|
|
|
greaterThan(0),
|
|
|
|
greaterThan(0),
|
|
|
@ -439,6 +438,10 @@ void main() {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
group('DebugPinballGame', () {
|
|
|
|
group('DebugPinballGame', () {
|
|
|
|
|
|
|
|
final debugModeFlameTester = FlameTester(
|
|
|
|
|
|
|
|
() => DebugPinballTestGame(assets: assets),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
debugModeFlameTester.test(
|
|
|
|
debugModeFlameTester.test(
|
|
|
|
'adds a ball on tap up',
|
|
|
|
'adds a ball on tap up',
|
|
|
|
(game) async {
|
|
|
|
(game) async {
|
|
|
@ -452,6 +455,7 @@ void main() {
|
|
|
|
when(() => tapUpEvent.eventPosition).thenReturn(eventPosition);
|
|
|
|
when(() => tapUpEvent.eventPosition).thenReturn(eventPosition);
|
|
|
|
when(() => tapUpEvent.raw).thenReturn(raw);
|
|
|
|
when(() => tapUpEvent.raw).thenReturn(raw);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await game.ready();
|
|
|
|
final previousBalls =
|
|
|
|
final previousBalls =
|
|
|
|
game.descendants().whereType<ControlledBall>().toList();
|
|
|
|
game.descendants().whereType<ControlledBall>().toList();
|
|
|
|
|
|
|
|
|
|
|
|