|
|
@ -3,7 +3,8 @@
|
|
|
|
import 'package:flame_forge2d/flame_forge2d.dart';
|
|
|
|
import 'package:flame_forge2d/flame_forge2d.dart';
|
|
|
|
import 'package:flame_test/flame_test.dart';
|
|
|
|
import 'package:flame_test/flame_test.dart';
|
|
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
import 'package:pinball_components/pinball_components.dart';
|
|
|
|
import 'package:mocktail/mocktail.dart';
|
|
|
|
|
|
|
|
import 'package:pinball/game/game.dart';
|
|
|
|
|
|
|
|
|
|
|
|
import '../../helpers/helpers.dart';
|
|
|
|
import '../../helpers/helpers.dart';
|
|
|
|
|
|
|
|
|
|
|
@ -41,5 +42,19 @@ void main() {
|
|
|
|
expect(drain.body.fixtures.first.isSensor, isTrue);
|
|
|
|
expect(drain.body.fixtures.first.isSensor, isTrue);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test(
|
|
|
|
|
|
|
|
'calls lost on contact with ball',
|
|
|
|
|
|
|
|
() async {
|
|
|
|
|
|
|
|
final drain = Drain();
|
|
|
|
|
|
|
|
final ball = MockControlledBall();
|
|
|
|
|
|
|
|
final controller = MockBallController();
|
|
|
|
|
|
|
|
when(() => ball.controller).thenReturn(controller);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
drain.beginContact(ball, MockContact());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
verify(controller.lost).called(1);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|