test: removed beginContact group

pull/234/head
alestiago 3 years ago
parent d91bb9c6c4
commit c3d8471a04

@ -23,27 +23,24 @@ void main() {
); );
}); });
group( flameTester.test(
'beginContact', 'beginContact emits onBallContacted when contacts with a ball',
() { (game) async {
flameTester.test('emits onBallContacted when contacts with a ball', final behavior = AlienBumperBallContactBehavior();
(game) async { final bloc = MockAlienBumperCubit();
final behavior = AlienBumperBallContactBehavior(); whenListen(
final bloc = MockAlienBumperCubit(); bloc,
whenListen( const Stream<AlienBumperState>.empty(),
bloc, initialState: AlienBumperState.active,
const Stream<AlienBumperState>.empty(), );
initialState: AlienBumperState.active,
); final alienBumper = AlienBumper.test(bloc: bloc);
await alienBumper.add(behavior);
final alienBumper = AlienBumper.test(bloc: bloc); await game.ensureAdd(alienBumper);
await alienBumper.add(behavior);
await game.ensureAdd(alienBumper); behavior.beginContact(MockBall(), MockContact());
behavior.beginContact(MockBall(), MockContact()); verify(alienBumper.bloc.onBallContacted).called(1);
verify(alienBumper.bloc.onBallContacted).called(1);
});
}, },
); );
}, },

@ -23,27 +23,24 @@ void main() {
); );
}); });
group( flameTester.test(
'beginContact', 'beginContact emits onBallContacted when contacts with a ball',
() { (game) async {
flameTester.test('emits onBallContacted when contacts with a ball', final behavior = DashNestBumperBallContactBehavior();
(game) async { final bloc = MockDashNestBumperCubit();
final behavior = DashNestBumperBallContactBehavior(); whenListen(
final bloc = MockDashNestBumperCubit(); bloc,
whenListen( const Stream<DashNestBumperState>.empty(),
bloc, initialState: DashNestBumperState.active,
const Stream<DashNestBumperState>.empty(), );
initialState: DashNestBumperState.active,
); final alienBumper = DashNestBumper.test(bloc: bloc);
await alienBumper.add(behavior);
final alienBumper = DashNestBumper.test(bloc: bloc); await game.ensureAdd(alienBumper);
await alienBumper.add(behavior);
await game.ensureAdd(alienBumper); behavior.beginContact(MockBall(), MockContact());
behavior.beginContact(MockBall(), MockContact()); verify(alienBumper.bloc.onBallContacted).called(1);
verify(alienBumper.bloc.onBallContacted).called(1);
});
}, },
); );
}, },

@ -23,27 +23,24 @@ void main() {
); );
}); });
group( flameTester.test(
'beginContact', 'beginContact emits onBallContacted when contacts with a ball',
() { (game) async {
flameTester.test('emits onBallContacted when contacts with a ball', final behavior = GoogleLetterBallContactBehavior();
(game) async { final bloc = MockGoogleLetterCubit();
final behavior = GoogleLetterBallContactBehavior(); whenListen(
final bloc = MockGoogleLetterCubit(); bloc,
whenListen( const Stream<GoogleLetterState>.empty(),
bloc, initialState: GoogleLetterState.active,
const Stream<GoogleLetterState>.empty(), );
initialState: GoogleLetterState.active,
); final googleLetter = GoogleLetter.test(bloc: bloc);
await googleLetter.add(behavior);
final googleLetter = GoogleLetter.test(bloc: bloc); await game.ensureAdd(googleLetter);
await googleLetter.add(behavior);
await game.ensureAdd(googleLetter); behavior.beginContact(MockBall(), MockContact());
behavior.beginContact(MockBall(), MockContact()); verify(googleLetter.bloc.onBallContacted).called(1);
verify(googleLetter.bloc.onBallContacted).called(1);
});
}, },
); );
}, },

@ -23,27 +23,24 @@ void main() {
); );
}); });
group( flameTester.test(
'beginContact', 'beginContact emits onBallContacted when contacts with a ball',
() { (game) async {
flameTester.test('emits onBallContacted when contacts with a ball', final behavior = SparkyBumperBallContactBehavior();
(game) async { final bloc = MockSparkyBumperCubit();
final behavior = SparkyBumperBallContactBehavior(); whenListen(
final bloc = MockSparkyBumperCubit(); bloc,
whenListen( const Stream<SparkyBumperState>.empty(),
bloc, initialState: SparkyBumperState.active,
const Stream<SparkyBumperState>.empty(), );
initialState: SparkyBumperState.active,
); final sparkyBumper = SparkyBumper.test(bloc: bloc);
await sparkyBumper.add(behavior);
final sparkyBumper = SparkyBumper.test(bloc: bloc); await game.ensureAdd(sparkyBumper);
await sparkyBumper.add(behavior);
await game.ensureAdd(sparkyBumper); behavior.beginContact(MockBall(), MockContact());
behavior.beginContact(MockBall(), MockContact()); verify(sparkyBumper.bloc.onBallContacted).called(1);
verify(sparkyBumper.bloc.onBallContacted).called(1);
});
}, },
); );
}, },

Loading…
Cancel
Save