|
|
@ -21,11 +21,10 @@ void main() {
|
|
|
|
flameTester.test(
|
|
|
|
flameTester.test(
|
|
|
|
'loads correctly',
|
|
|
|
'loads correctly',
|
|
|
|
(game) async {
|
|
|
|
(game) async {
|
|
|
|
final boattomGroup = BottomGroup();
|
|
|
|
final bottomGroup = BottomGroup();
|
|
|
|
await game.ready();
|
|
|
|
await game.ensureAdd(bottomGroup);
|
|
|
|
await game.ensureAdd(boattomGroup);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
expect(game.contains(boattomGroup), isTrue);
|
|
|
|
expect(game.contains(bottomGroup), isTrue);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
@ -33,12 +32,11 @@ void main() {
|
|
|
|
flameTester.test(
|
|
|
|
flameTester.test(
|
|
|
|
'one left flipper',
|
|
|
|
'one left flipper',
|
|
|
|
(game) async {
|
|
|
|
(game) async {
|
|
|
|
final boattomGroup = BottomGroup();
|
|
|
|
final bottomGroup = BottomGroup();
|
|
|
|
await game.ready();
|
|
|
|
await game.ensureAdd(bottomGroup);
|
|
|
|
await game.ensureAdd(boattomGroup);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final leftFlippers =
|
|
|
|
final leftFlippers =
|
|
|
|
boattomGroup.descendants().whereType<Flipper>().where(
|
|
|
|
bottomGroup.descendants().whereType<Flipper>().where(
|
|
|
|
(flipper) => flipper.side.isLeft,
|
|
|
|
(flipper) => flipper.side.isLeft,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
expect(leftFlippers.length, equals(1));
|
|
|
|
expect(leftFlippers.length, equals(1));
|
|
|
@ -48,11 +46,10 @@ void main() {
|
|
|
|
flameTester.test(
|
|
|
|
flameTester.test(
|
|
|
|
'one right flipper',
|
|
|
|
'one right flipper',
|
|
|
|
(game) async {
|
|
|
|
(game) async {
|
|
|
|
final boattomGroup = BottomGroup();
|
|
|
|
final bottomGroup = BottomGroup();
|
|
|
|
await game.ready();
|
|
|
|
await game.ensureAdd(bottomGroup);
|
|
|
|
await game.ensureAdd(boattomGroup);
|
|
|
|
|
|
|
|
final rightFlippers =
|
|
|
|
final rightFlippers =
|
|
|
|
boattomGroup.descendants().whereType<Flipper>().where(
|
|
|
|
bottomGroup.descendants().whereType<Flipper>().where(
|
|
|
|
(flipper) => flipper.side.isRight,
|
|
|
|
(flipper) => flipper.side.isRight,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
expect(rightFlippers.length, equals(1));
|
|
|
|
expect(rightFlippers.length, equals(1));
|
|
|
@ -62,24 +59,22 @@ void main() {
|
|
|
|
flameTester.test(
|
|
|
|
flameTester.test(
|
|
|
|
'two Baseboards',
|
|
|
|
'two Baseboards',
|
|
|
|
(game) async {
|
|
|
|
(game) async {
|
|
|
|
final boattomGroup = BottomGroup();
|
|
|
|
final bottomGroup = BottomGroup();
|
|
|
|
await game.ready();
|
|
|
|
await game.ensureAdd(bottomGroup);
|
|
|
|
await game.ensureAdd(boattomGroup);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final baseboattomGroups =
|
|
|
|
final basebottomGroups =
|
|
|
|
boattomGroup.descendants().whereType<Baseboard>();
|
|
|
|
bottomGroup.descendants().whereType<Baseboard>();
|
|
|
|
expect(baseboattomGroups.length, equals(2));
|
|
|
|
expect(basebottomGroups.length, equals(2));
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
flameTester.test(
|
|
|
|
flameTester.test(
|
|
|
|
'two Kickers',
|
|
|
|
'two Kickers',
|
|
|
|
(game) async {
|
|
|
|
(game) async {
|
|
|
|
final boattomGroup = BottomGroup();
|
|
|
|
final bottomGroup = BottomGroup();
|
|
|
|
await game.ready();
|
|
|
|
await game.ensureAdd(bottomGroup);
|
|
|
|
await game.ensureAdd(boattomGroup);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final kickers = boattomGroup.descendants().whereType<Kicker>();
|
|
|
|
final kickers = bottomGroup.descendants().whereType<Kicker>();
|
|
|
|
expect(kickers.length, equals(2));
|
|
|
|
expect(kickers.length, equals(2));
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
);
|
|
|
|