From 4549b3f2b7c6db3713fb4d322d2c6b3dc1d274d2 Mon Sep 17 00:00:00 2001 From: RuiAlonso Date: Wed, 30 Mar 2022 15:38:34 +0200 Subject: [PATCH] refactor: reordered mocks at tests --- .../components/spaceship_exit_rail_test.dart | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/test/game/components/spaceship_exit_rail_test.dart b/test/game/components/spaceship_exit_rail_test.dart index 1a6efc19..529bc784 100644 --- a/test/game/components/spaceship_exit_rail_test.dart +++ b/test/game/components/spaceship_exit_rail_test.dart @@ -8,29 +8,27 @@ import '../../helpers/helpers.dart'; void main() { group('SpaceshipExitRail', () { - late Filter filterData; - late Fixture fixture; - late Body body; late PinballGame game; - late Ball ball; late SpaceshipExitRailEnd exitRailEnd; + late Ball ball; + late Body body; + late Fixture fixture; + late Filter filterData; setUp(() { - filterData = MockFilter(); - - fixture = MockFixture(); - when(() => fixture.filterData).thenReturn(filterData); - - body = MockBody(); - when(() => body.fixtures).thenReturn([fixture]); - game = MockPinballGame(); + exitRailEnd = MockSpaceshipExitRailEnd(); + ball = MockBall(); when(() => ball.gameRef).thenReturn(game); when(() => ball.body).thenReturn(body); - exitRailEnd = MockSpaceshipExitRailEnd(); + body = MockBody(); + fixture = MockFixture(); + filterData = MockFilter(); + when(() => body.fixtures).thenReturn([fixture]); + when(() => fixture.filterData).thenReturn(filterData); }); group('SpaceshipExitHoleBallContactCallback', () {