|
|
|
@ -63,6 +63,30 @@ void main() {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
group('adds', () {
|
|
|
|
|
flameTester.test('an AndroidBumperBallContactBehavior', (game) async {
|
|
|
|
|
final androidBumper = AndroidBumper.a();
|
|
|
|
|
await game.ensureAdd(androidBumper);
|
|
|
|
|
expect(
|
|
|
|
|
androidBumper.children
|
|
|
|
|
.whereType<AndroidBumperBallContactBehavior>()
|
|
|
|
|
.single,
|
|
|
|
|
isNotNull,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
flameTester.test('an AndroidBumperBlinkingBehavior', (game) async {
|
|
|
|
|
final androidBumper = AndroidBumper.a();
|
|
|
|
|
await game.ensureAdd(androidBumper);
|
|
|
|
|
expect(
|
|
|
|
|
androidBumper.children
|
|
|
|
|
.whereType<AndroidBumperBlinkingBehavior>()
|
|
|
|
|
.single,
|
|
|
|
|
isNotNull,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
group("'a' adds", () {
|
|
|
|
|
flameTester.test('new children', (game) async {
|
|
|
|
|
final component = Component();
|
|
|
|
|
final androidBumper = AndroidBumper.a(
|
|
|
|
@ -72,19 +96,48 @@ void main() {
|
|
|
|
|
expect(androidBumper.children, contains(component));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
flameTester.test('an AndroidBumperBallContactBehavior', (game) async {
|
|
|
|
|
flameTester.test('a BumpingBehavior', (game) async {
|
|
|
|
|
final androidBumper = AndroidBumper.a();
|
|
|
|
|
await game.ensureAdd(androidBumper);
|
|
|
|
|
expect(
|
|
|
|
|
androidBumper.children
|
|
|
|
|
.whereType<AndroidBumperBallContactBehavior>()
|
|
|
|
|
.single,
|
|
|
|
|
androidBumper.children.whereType<BumpingBehavior>().single,
|
|
|
|
|
isNotNull,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
group("'b' adds", () {
|
|
|
|
|
flameTester.test('new children', (game) async {
|
|
|
|
|
final component = Component();
|
|
|
|
|
final androidBumper = AndroidBumper.b(
|
|
|
|
|
children: [component],
|
|
|
|
|
);
|
|
|
|
|
await game.ensureAdd(androidBumper);
|
|
|
|
|
expect(androidBumper.children, contains(component));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
flameTester.test('a BumpingBehavior', (game) async {
|
|
|
|
|
final androidBumper = AndroidBumper.a();
|
|
|
|
|
final androidBumper = AndroidBumper.b();
|
|
|
|
|
await game.ensureAdd(androidBumper);
|
|
|
|
|
expect(
|
|
|
|
|
androidBumper.children.whereType<BumpingBehavior>().single,
|
|
|
|
|
isNotNull,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
group("'cow' adds", () {
|
|
|
|
|
flameTester.test('new children', (game) async {
|
|
|
|
|
final component = Component();
|
|
|
|
|
final androidBumper = AndroidBumper.cow(
|
|
|
|
|
children: [component],
|
|
|
|
|
);
|
|
|
|
|
await game.ensureAdd(androidBumper);
|
|
|
|
|
expect(androidBumper.children, contains(component));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
flameTester.test('a BumpingBehavior', (game) async {
|
|
|
|
|
final androidBumper = AndroidBumper.cow();
|
|
|
|
|
await game.ensureAdd(androidBumper);
|
|
|
|
|
expect(
|
|
|
|
|
androidBumper.children.whereType<BumpingBehavior>().single,
|
|
|
|
|