test: make dino wall private and removed golden tests for them

pull/115/head
RuiAlonso 4 years ago
parent f62ee0bc1c
commit 575d40fd12

@ -20,8 +20,8 @@ class DinoWalls extends Forge2DBlueprint {
@override
void build(_) {
addAll([
DinoTopWall()..initialPosition = position,
DinoBottomWall()..initialPosition = position,
_DinoTopWall()..initialPosition = position,
_DinoBottomWall()..initialPosition = position,
]);
}
}
@ -29,9 +29,9 @@ class DinoWalls extends Forge2DBlueprint {
/// {@template dino_top_wall}
/// Wall segment located above [ChromeDino].
/// {@endtemplate}
class DinoTopWall extends BodyComponent with InitialPosition {
class _DinoTopWall extends BodyComponent with InitialPosition {
///{@macro dino_top_wall}
DinoTopWall() : super(priority: 2);
_DinoTopWall() : super(priority: 2);
List<FixtureDef> _createFixtureDefs() {
final fixturesDef = <FixtureDef>[];
@ -127,9 +127,9 @@ class DinoTopWall extends BodyComponent with InitialPosition {
/// {@template dino_bottom_wall}
/// Wall segment located below [ChromeDino].
/// {@endtemplate}
class DinoBottomWall extends BodyComponent with InitialPosition {
class _DinoBottomWall extends BodyComponent with InitialPosition {
///{@macro dino_top_wall}
DinoBottomWall() : super(priority: 2);
_DinoBottomWall() : super(priority: 2);
List<FixtureDef> _createFixtureDefs() {
final fixturesDef = <FixtureDef>[];

@ -24,39 +24,5 @@ void main() {
}
},
);
group('DinoTopWall', () {
flameTester.testGameWidget(
'renders correctly',
setUp: (game, tester) async {
await game.ensureAdd(
DinoTopWall()..initialPosition = Vector2(0, -50),
);
},
verify: (game, tester) async {
await expectLater(
find.byGame<Forge2DGame>(),
matchesGoldenFile('golden/dino-top-wall.png'),
);
},
);
});
group('DinoBottomWall', () {
flameTester.testGameWidget(
'renders correctly',
setUp: (game, tester) async {
await game.ensureAdd(
DinoBottomWall()..initialPosition = Vector2(0, -12),
);
},
verify: (game, tester) async {
await expectLater(
find.byGame<Forge2DGame>(),
matchesGoldenFile('golden/dino-bottom-wall.png'),
);
},
);
});
});
}

Loading…
Cancel
Save