|
|
@ -41,6 +41,7 @@ void main() {
|
|
|
|
await tester.pump();
|
|
|
|
await tester.pump();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
verify: (game, tester) async {
|
|
|
|
verify: (game, tester) async {
|
|
|
|
|
|
|
|
const goldenFilePath = '../golden/android_spaceship/';
|
|
|
|
final animationDuration = game
|
|
|
|
final animationDuration = game
|
|
|
|
.descendants()
|
|
|
|
.descendants()
|
|
|
|
.whereType<SpriteAnimationComponent>()
|
|
|
|
.whereType<SpriteAnimationComponent>()
|
|
|
@ -50,21 +51,21 @@ void main() {
|
|
|
|
|
|
|
|
|
|
|
|
await expectLater(
|
|
|
|
await expectLater(
|
|
|
|
find.byGame<TestGame>(),
|
|
|
|
find.byGame<TestGame>(),
|
|
|
|
matchesGoldenFile('../golden/android_spaceship/start.png'),
|
|
|
|
matchesGoldenFile('${goldenFilePath}start.png'),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
game.update(animationDuration * 0.5);
|
|
|
|
game.update(animationDuration * 0.5);
|
|
|
|
await tester.pump();
|
|
|
|
await tester.pump();
|
|
|
|
await expectLater(
|
|
|
|
await expectLater(
|
|
|
|
find.byGame<TestGame>(),
|
|
|
|
find.byGame<TestGame>(),
|
|
|
|
matchesGoldenFile('../golden/android_spaceship/middle.png'),
|
|
|
|
matchesGoldenFile('${goldenFilePath}middle.png'),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
game.update(animationDuration * 0.5);
|
|
|
|
game.update(animationDuration * 0.5);
|
|
|
|
await tester.pump();
|
|
|
|
await tester.pump();
|
|
|
|
await expectLater(
|
|
|
|
await expectLater(
|
|
|
|
find.byGame<TestGame>(),
|
|
|
|
find.byGame<TestGame>(),
|
|
|
|
matchesGoldenFile('../golden/android_spaceship/end.png'),
|
|
|
|
matchesGoldenFile('${goldenFilePath}end.png'),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -77,7 +78,7 @@ void main() {
|
|
|
|
whenListen(
|
|
|
|
whenListen(
|
|
|
|
bloc,
|
|
|
|
bloc,
|
|
|
|
const Stream<AndroidSpaceshipState>.empty(),
|
|
|
|
const Stream<AndroidSpaceshipState>.empty(),
|
|
|
|
initialState: AndroidSpaceshipState.idle,
|
|
|
|
initialState: AndroidSpaceshipState.withoutBonus,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
when(bloc.close).thenAnswer((_) async {});
|
|
|
|
when(bloc.close).thenAnswer((_) async {});
|
|
|
|
final androidSpaceship = AndroidSpaceship.test(bloc: bloc);
|
|
|
|
final androidSpaceship = AndroidSpaceship.test(bloc: bloc);
|
|
|
|