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.
pinball/test/start_game/bloc/start_game_bloc_test.dart

52 lines
1.4 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 ReplayTapped changes status to selectCharacter',
build: StartGameBloc.new,
act: (bloc) => bloc.add(const ReplayTapped()),
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,
)
],
);
});
}