test: fix tests

pull/40/head
RuiAlonso 4 years ago
parent e5d59c20cc
commit 716dc866d2

@ -67,6 +67,7 @@ void main() {
position: Vector2.zero(), position: Vector2.zero(),
categoryBits: RampType.all.maskBits, categoryBits: RampType.all.maskBits,
); );
await game.ready();
await game.ensureAdd(ramp); await game.ensureAdd(ramp);
expect(game.contains(ramp), isTrue); expect(game.contains(ramp), isTrue);

@ -66,7 +66,8 @@ void main() {
await game.ready(); await game.ready();
await game.ensureAdd(jetpackRamp); await game.ensureAdd(jetpackRamp);
final rampAreas = game.children.whereType<JetpackRampArea>().toList(); final rampAreas =
jetpackRamp.children.whereType<JetpackRampArea>().toList();
expect(rampAreas.length, 2); expect(rampAreas.length, 2);
}, },
); );
@ -80,7 +81,8 @@ void main() {
await game.ready(); await game.ready();
await game.ensureAdd(jetpackRamp); await game.ensureAdd(jetpackRamp);
final rampAreas = game.children.whereType<JetpackRampArea>().toList(); final rampAreas =
jetpackRamp.children.whereType<JetpackRampArea>().toList();
for (final rampArea in rampAreas) { for (final rampArea in rampAreas) {
expect(rampArea.body.bodyType, equals(BodyType.static)); expect(rampArea.body.bodyType, equals(BodyType.static));
} }

@ -32,7 +32,7 @@ void main() {
await game.ensureAdd(sparkyRamp); await game.ensureAdd(sparkyRamp);
expect( expect(
() => game.children.singleWhere( () => sparkyRamp.children.singleWhere(
pathwaySelector(position), pathwaySelector(position),
), ),
returnsNormally, returnsNormally,
@ -66,7 +66,8 @@ void main() {
await game.ready(); await game.ready();
await game.ensureAdd(sparkyRamp); await game.ensureAdd(sparkyRamp);
final rampAreas = game.children.whereType<SparkyRampArea>().toList(); final rampAreas =
sparkyRamp.children.whereType<SparkyRampArea>().toList();
expect(rampAreas.length, 2); expect(rampAreas.length, 2);
}, },
); );
@ -80,7 +81,8 @@ void main() {
await game.ready(); await game.ready();
await game.ensureAdd(sparkyRamp); await game.ensureAdd(sparkyRamp);
final rampAreas = game.children.whereType<SparkyRampArea>().toList(); final rampAreas =
sparkyRamp.children.whereType<SparkyRampArea>().toList();
for (final rampArea in rampAreas) { for (final rampArea in rampAreas) {
expect(rampArea.body.bodyType, equals(BodyType.static)); expect(rampArea.body.bodyType, equals(BodyType.static));
} }

Loading…
Cancel
Save