|
|
@ -11,10 +11,10 @@ import '../../helpers/helpers.dart';
|
|
|
|
|
|
|
|
|
|
|
|
void main() {
|
|
|
|
void main() {
|
|
|
|
TestWidgetsFlutterBinding.ensureInitialized();
|
|
|
|
TestWidgetsFlutterBinding.ensureInitialized();
|
|
|
|
final flameTester = FlameTester(EmptyPinballGameTest.new);
|
|
|
|
final flameTester = FlameTester(EmptyPinballTestGame.new);
|
|
|
|
|
|
|
|
|
|
|
|
final gameOverBlocTester = FlameBlocTester<EmptyPinballGameTest, GameBloc>(
|
|
|
|
final flameBlocTester = FlameBlocTester<EmptyPinballTestGame, GameBloc>(
|
|
|
|
gameBuilder: EmptyPinballGameTest.new,
|
|
|
|
gameBuilder: EmptyPinballTestGame.new,
|
|
|
|
blocBuilder: () {
|
|
|
|
blocBuilder: () {
|
|
|
|
final bloc = MockGameBloc();
|
|
|
|
final bloc = MockGameBloc();
|
|
|
|
const state = GameState(
|
|
|
|
const state = GameState(
|
|
|
@ -65,7 +65,7 @@ void main() {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
testRawKeyDownEvents(leftKeys, (event) {
|
|
|
|
testRawKeyDownEvents(leftKeys, (event) {
|
|
|
|
gameOverBlocTester.testGameWidget(
|
|
|
|
flameBlocTester.testGameWidget(
|
|
|
|
'does nothing when is game over',
|
|
|
|
'does nothing when is game over',
|
|
|
|
setUp: (game, tester) async {
|
|
|
|
setUp: (game, tester) async {
|
|
|
|
await game.ensureAdd(flipper);
|
|
|
|
await game.ensureAdd(flipper);
|
|
|
@ -150,7 +150,7 @@ void main() {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
testRawKeyDownEvents(rightKeys, (event) {
|
|
|
|
testRawKeyDownEvents(rightKeys, (event) {
|
|
|
|
gameOverBlocTester.testGameWidget(
|
|
|
|
flameBlocTester.testGameWidget(
|
|
|
|
'does nothing when is game over',
|
|
|
|
'does nothing when is game over',
|
|
|
|
setUp: (game, tester) async {
|
|
|
|
setUp: (game, tester) async {
|
|
|
|
await game.ensureAdd(flipper);
|
|
|
|
await game.ensureAdd(flipper);
|
|
|
|