fix: fixing old tests

pull/151/head
alestiago 4 years ago
parent 59dd003e2c
commit b699e7a15d

@ -17,11 +17,23 @@ void main() {
group('BonusBallController', () {
late Ball ball;
late GameBloc gameBloc;
setUp(() {
ball = Ball(baseColor: const Color(0xFF00FFFF));
gameBloc = MockGameBloc();
whenListen(
gameBloc,
const Stream<GameState>.empty(),
initialState: const GameState.initial(),
);
});
final flameBlocTester = FlameBlocTester(
gameBuilder: EmptyPinballGameTest.new,
blocBuilder: () => gameBloc,
);
test('can be instantiated', () {
expect(
BonusBallController(ball),
@ -29,9 +41,9 @@ void main() {
);
});
flameTester.test(
flameBlocTester.testGameWidget(
'lost removes ball',
(game) async {
setUp: (game, tester) async {
await game.add(ball);
final controller = BonusBallController(ball);
await ball.ensureAdd(controller);

@ -20,11 +20,8 @@ void main() {
final wall = MockBottomWall();
final ballController = MockBallController();
final ball = MockControlledBall();
final componentSet = MockComponentSet();
when(() => componentSet.whereType<BallController>())
.thenReturn([ballController]);
when(() => ball.children).thenReturn(componentSet);
when(() => ball.controller).thenReturn(ballController);
BottomWallBallContactCallback().begin(ball, wall, MockContact());

Loading…
Cancel
Save