|
|
@ -63,6 +63,30 @@ void main() {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
group('adds', () {
|
|
|
|
group('adds', () {
|
|
|
|
|
|
|
|
flameTester.test('a SparkyBumperBallContactBehavior', (game) async {
|
|
|
|
|
|
|
|
final sparkyBumper = SparkyBumper.a();
|
|
|
|
|
|
|
|
await game.ensureAdd(sparkyBumper);
|
|
|
|
|
|
|
|
expect(
|
|
|
|
|
|
|
|
sparkyBumper.children
|
|
|
|
|
|
|
|
.whereType<SparkyBumperBallContactBehavior>()
|
|
|
|
|
|
|
|
.single,
|
|
|
|
|
|
|
|
isNotNull,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
flameTester.test('a SparkyBumperBlinkingBehavior', (game) async {
|
|
|
|
|
|
|
|
final sparkyBumper = SparkyBumper.a();
|
|
|
|
|
|
|
|
await game.ensureAdd(sparkyBumper);
|
|
|
|
|
|
|
|
expect(
|
|
|
|
|
|
|
|
sparkyBumper.children
|
|
|
|
|
|
|
|
.whereType<SparkyBumperBlinkingBehavior>()
|
|
|
|
|
|
|
|
.single,
|
|
|
|
|
|
|
|
isNotNull,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
group("'a' adds", () {
|
|
|
|
flameTester.test('new children', (game) async {
|
|
|
|
flameTester.test('new children', (game) async {
|
|
|
|
final component = Component();
|
|
|
|
final component = Component();
|
|
|
|
final sparkyBumper = SparkyBumper.a(
|
|
|
|
final sparkyBumper = SparkyBumper.a(
|
|
|
@ -72,19 +96,47 @@ void main() {
|
|
|
|
expect(sparkyBumper.children, contains(component));
|
|
|
|
expect(sparkyBumper.children, contains(component));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
flameTester.test('a SparkyBumperBallContactBehavior', (game) async {
|
|
|
|
flameTester.test('a BumpingBehavior', (game) async {
|
|
|
|
final sparkyBumper = SparkyBumper.a();
|
|
|
|
final sparkyBumper = SparkyBumper.a();
|
|
|
|
await game.ensureAdd(sparkyBumper);
|
|
|
|
await game.ensureAdd(sparkyBumper);
|
|
|
|
expect(
|
|
|
|
expect(
|
|
|
|
sparkyBumper.children
|
|
|
|
sparkyBumper.children.whereType<BumpingBehavior>().single,
|
|
|
|
.whereType<SparkyBumperBallContactBehavior>()
|
|
|
|
isNotNull,
|
|
|
|
.single,
|
|
|
|
);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
group("'b' adds", () {
|
|
|
|
|
|
|
|
flameTester.test('new children', (game) async {
|
|
|
|
|
|
|
|
final component = Component();
|
|
|
|
|
|
|
|
final sparkyBumper = SparkyBumper.b(
|
|
|
|
|
|
|
|
children: [component],
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
await game.ensureAdd(sparkyBumper);
|
|
|
|
|
|
|
|
expect(sparkyBumper.children, contains(component));
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
flameTester.test('a BumpingBehavior', (game) async {
|
|
|
|
|
|
|
|
final sparkyBumper = SparkyBumper.b();
|
|
|
|
|
|
|
|
await game.ensureAdd(sparkyBumper);
|
|
|
|
|
|
|
|
expect(
|
|
|
|
|
|
|
|
sparkyBumper.children.whereType<BumpingBehavior>().single,
|
|
|
|
isNotNull,
|
|
|
|
isNotNull,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
group("'c' adds", () {
|
|
|
|
|
|
|
|
flameTester.test('new children', (game) async {
|
|
|
|
|
|
|
|
final component = Component();
|
|
|
|
|
|
|
|
final sparkyBumper = SparkyBumper.c(
|
|
|
|
|
|
|
|
children: [component],
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
await game.ensureAdd(sparkyBumper);
|
|
|
|
|
|
|
|
expect(sparkyBumper.children, contains(component));
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
flameTester.test('a BumpingBehavior', (game) async {
|
|
|
|
flameTester.test('a BumpingBehavior', (game) async {
|
|
|
|
final sparkyBumper = SparkyBumper.a();
|
|
|
|
final sparkyBumper = SparkyBumper.c();
|
|
|
|
await game.ensureAdd(sparkyBumper);
|
|
|
|
await game.ensureAdd(sparkyBumper);
|
|
|
|
expect(
|
|
|
|
expect(
|
|
|
|
sparkyBumper.children.whereType<BumpingBehavior>().single,
|
|
|
|
sparkyBumper.children.whereType<BumpingBehavior>().single,
|
|
|
@ -93,4 +145,5 @@ void main() {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|