feat: included loads correctly test

pull/6/head
alestiago 4 years ago
parent 5fdc628f47
commit 51b9941b19

@ -7,6 +7,17 @@ void main() {
TestWidgetsFlutterBinding.ensureInitialized(); TestWidgetsFlutterBinding.ensureInitialized();
group('Ball', () { group('Ball', () {
FlameTester(PinballGame.new).test(
'loads correctly',
(game) async {
final position = Vector2(10, 10);
final ball = Ball(position: position);
await game.ensureAdd(ball);
expect(game.contains(ball), isTrue);
},
);
group('body', () { group('body', () {
FlameTester(PinballGame.new).test( FlameTester(PinballGame.new).test(
'positions correctly', 'positions correctly',
@ -14,6 +25,7 @@ void main() {
final position = Vector2(10, 10); final position = Vector2(10, 10);
final ball = Ball(position: position); final ball = Ball(position: position);
await game.ensureAdd(ball); await game.ensureAdd(ball);
game.contains(ball);
expect(ball.body.position, position); expect(ball.body.position, position);
}, },

Loading…
Cancel
Save