|
|
@ -1,7 +1,5 @@
|
|
|
|
// ignore_for_file: cascade_invocations
|
|
|
|
// ignore_for_file: cascade_invocations
|
|
|
|
|
|
|
|
|
|
|
|
import 'dart:math';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:bloc_test/bloc_test.dart';
|
|
|
|
import 'package:bloc_test/bloc_test.dart';
|
|
|
|
import 'package:flame_test/flame_test.dart';
|
|
|
|
import 'package:flame_test/flame_test.dart';
|
|
|
|
import 'package:flutter/painting.dart';
|
|
|
|
import 'package:flutter/painting.dart';
|
|
|
@ -36,8 +34,7 @@ void main() {
|
|
|
|
(game) async {
|
|
|
|
(game) async {
|
|
|
|
await game.add(ball);
|
|
|
|
await game.add(ball);
|
|
|
|
final controller = BonusBallController(ball);
|
|
|
|
final controller = BonusBallController(ball);
|
|
|
|
await ball.add(controller);
|
|
|
|
await ball.ensureAdd(controller);
|
|
|
|
await game.ready();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
controller.lost();
|
|
|
|
controller.lost();
|
|
|
|
await game.ready();
|
|
|
|
await game.ready();
|
|
|
@ -79,8 +76,7 @@ void main() {
|
|
|
|
setUp: (game, tester) async {
|
|
|
|
setUp: (game, tester) async {
|
|
|
|
final controller = LaunchedBallController(ball);
|
|
|
|
final controller = LaunchedBallController(ball);
|
|
|
|
await ball.add(controller);
|
|
|
|
await ball.add(controller);
|
|
|
|
await game.add(ball);
|
|
|
|
await game.ensureAdd(ball);
|
|
|
|
await game.ready();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
controller.lost();
|
|
|
|
controller.lost();
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -96,8 +92,7 @@ void main() {
|
|
|
|
final controller = LaunchedBallController(ball);
|
|
|
|
final controller = LaunchedBallController(ball);
|
|
|
|
|
|
|
|
|
|
|
|
await ball.add(controller);
|
|
|
|
await ball.add(controller);
|
|
|
|
await game.add(ball);
|
|
|
|
await game.ensureAdd(ball);
|
|
|
|
await game.ready();
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
verify: (game, tester) async {
|
|
|
|
verify: (game, tester) async {
|
|
|
|
final controller =
|
|
|
|
final controller =
|
|
|
@ -118,8 +113,7 @@ void main() {
|
|
|
|
final controller = LaunchedBallController(ball);
|
|
|
|
final controller = LaunchedBallController(ball);
|
|
|
|
|
|
|
|
|
|
|
|
await ball.add(controller);
|
|
|
|
await ball.add(controller);
|
|
|
|
await game.add(ball);
|
|
|
|
await game.ensureAdd(ball);
|
|
|
|
await game.ready();
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
verify: (game, tester) async {
|
|
|
|
verify: (game, tester) async {
|
|
|
|
final controller =
|
|
|
|
final controller =
|
|
|
@ -141,8 +135,7 @@ void main() {
|
|
|
|
setUp: (game, tester) async {
|
|
|
|
setUp: (game, tester) async {
|
|
|
|
final controller = LaunchedBallController(ball);
|
|
|
|
final controller = LaunchedBallController(ball);
|
|
|
|
await ball.add(controller);
|
|
|
|
await ball.add(controller);
|
|
|
|
await game.add(ball);
|
|
|
|
await game.ensureAdd(ball);
|
|
|
|
await game.ready();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final state = MockGameState();
|
|
|
|
final state = MockGameState();
|
|
|
|
when(() => state.balls).thenReturn(1);
|
|
|
|
when(() => state.balls).thenReturn(1);
|
|
|
@ -159,8 +152,7 @@ void main() {
|
|
|
|
setUp: (game, tester) async {
|
|
|
|
setUp: (game, tester) async {
|
|
|
|
final controller = LaunchedBallController(ball);
|
|
|
|
final controller = LaunchedBallController(ball);
|
|
|
|
await ball.add(controller);
|
|
|
|
await ball.add(controller);
|
|
|
|
await game.add(ball);
|
|
|
|
await game.ensureAdd(ball);
|
|
|
|
await game.ready();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final state = MockGameState();
|
|
|
|
final state = MockGameState();
|
|
|
|
when(() => state.balls).thenReturn(2);
|
|
|
|
when(() => state.balls).thenReturn(2);
|
|
|
@ -181,8 +173,7 @@ void main() {
|
|
|
|
setUp: (game, tester) async {
|
|
|
|
setUp: (game, tester) async {
|
|
|
|
final controller = LaunchedBallController(ball);
|
|
|
|
final controller = LaunchedBallController(ball);
|
|
|
|
await ball.add(controller);
|
|
|
|
await ball.add(controller);
|
|
|
|
await game.add(ball);
|
|
|
|
await game.ensureAdd(ball);
|
|
|
|
await game.ready();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final state = MockGameState();
|
|
|
|
final state = MockGameState();
|
|
|
|
when(() => state.balls).thenReturn(1);
|
|
|
|
when(() => state.balls).thenReturn(1);
|
|
|
|