fix: provided MockBody to all tests

pull/210/head
alestiago 3 years ago
parent ee43773e35
commit 7423182682

@ -28,9 +28,13 @@ void main() {
setUp(() { setUp(() {
game = MockPinballGame(); game = MockPinballGame();
bloc = MockGameBloc(); bloc = MockGameBloc();
ball = MockBall();
audio = MockPinballAudio(); audio = MockPinballAudio();
fakeScorePoints = FakeScorePoints(); fakeScorePoints = FakeScorePoints();
ball = MockBall();
final ballBody = MockBody();
when(() => ball.body).thenReturn(ballBody);
when(() => ballBody.position).thenReturn(Vector2.all(4));
}); });
setUpAll(() { setUpAll(() {
@ -79,9 +83,6 @@ void main() {
() { () {
when(game.read<GameBloc>).thenReturn(bloc); when(game.read<GameBloc>).thenReturn(bloc);
when(() => game.audio).thenReturn(audio); when(() => game.audio).thenReturn(audio);
final ballBody = MockBody();
when(() => ball.body).thenReturn(ballBody);
when(() => ballBody.position).thenReturn(Vector2.all(4));
BallScorePointsCallback(game).begin( BallScorePointsCallback(game).begin(
ball, ball,

Loading…
Cancel
Save