mirror of https://github.com/flutter/pinball.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.1 KiB
41 lines
1.1 KiB
import 'package:bloc_test/bloc_test.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:pinball/start_game/bloc/start_game_bloc.dart';
|
|
|
|
void main() {
|
|
group('StartGameBloc', () {
|
|
blocTest<StartGameBloc, StartGameState>(
|
|
'on PlayTapped changes status to selectCharacter',
|
|
build: StartGameBloc.new,
|
|
act: (bloc) => bloc.add(const PlayTapped()),
|
|
expect: () => [
|
|
const StartGameState(
|
|
status: StartGameStatus.selectCharacter,
|
|
)
|
|
],
|
|
);
|
|
|
|
blocTest<StartGameBloc, StartGameState>(
|
|
'on CharacterSelected changes status to howToPlay',
|
|
build: StartGameBloc.new,
|
|
act: (bloc) => bloc.add(const CharacterSelected()),
|
|
expect: () => [
|
|
const StartGameState(
|
|
status: StartGameStatus.howToPlay,
|
|
)
|
|
],
|
|
);
|
|
|
|
blocTest<StartGameBloc, StartGameState>(
|
|
'on HowToPlayFinished changes status to play',
|
|
build: StartGameBloc.new,
|
|
act: (bloc) => bloc.add(const HowToPlayFinished()),
|
|
expect: () => [
|
|
const StartGameState(
|
|
status: StartGameStatus.play,
|
|
)
|
|
],
|
|
);
|
|
});
|
|
}
|