From c305a09980228e9a5a2d2738263ce4662dbd000b Mon Sep 17 00:00:00 2001 From: Alejandro Santiago Date: Sat, 7 May 2022 23:53:14 +0100 Subject: [PATCH] refactor: removed SparkyTurboChargeActivated event (#401) --- lib/game/bloc/game_bloc.dart | 15 --------------- lib/game/bloc/game_event.dart | 7 ------- test/game/bloc/game_bloc_test.dart | 16 ---------------- test/game/bloc/game_event_test.dart | 13 ------------- 4 files changed, 51 deletions(-) diff --git a/lib/game/bloc/game_bloc.dart b/lib/game/bloc/game_bloc.dart index d00e5da1..795d04e2 100644 --- a/lib/game/bloc/game_bloc.dart +++ b/lib/game/bloc/game_bloc.dart @@ -12,7 +12,6 @@ class GameBloc extends Bloc { on(_onScored); on(_onIncreasedMultiplier); on(_onBonusActivated); - on(_onSparkyTurboChargeActivated); on(_onGameOver); on(_onGameStarted); } @@ -65,18 +64,4 @@ class GameBloc extends Bloc { ), ); } - - Future _onSparkyTurboChargeActivated( - SparkyTurboChargeActivated event, - Emitter emit, - ) async { - emit( - state.copyWith( - bonusHistory: [ - ...state.bonusHistory, - GameBonus.sparkyTurboCharge, - ], - ), - ); - } } diff --git a/lib/game/bloc/game_event.dart b/lib/game/bloc/game_event.dart index a8e8593b..126ba299 100644 --- a/lib/game/bloc/game_event.dart +++ b/lib/game/bloc/game_event.dart @@ -40,13 +40,6 @@ class BonusActivated extends GameEvent { List get props => [bonus]; } -class SparkyTurboChargeActivated extends GameEvent { - const SparkyTurboChargeActivated(); - - @override - List get props => []; -} - /// {@template multiplier_increased_game_event} /// Added when a multiplier is gained. /// {@endtemplate} diff --git a/test/game/bloc/game_bloc_test.dart b/test/game/bloc/game_bloc_test.dart index 3e5abb74..9e8c6354 100644 --- a/test/game/bloc/game_bloc_test.dart +++ b/test/game/bloc/game_bloc_test.dart @@ -279,21 +279,5 @@ void main() { ); }, ); - - group('SparkyTurboChargeActivated', () { - blocTest( - 'adds game bonus', - build: GameBloc.new, - act: (bloc) => bloc..add(const SparkyTurboChargeActivated()), - expect: () => [ - isA() - ..having( - (state) => state.bonusHistory, - 'bonusHistory', - [GameBonus.sparkyTurboCharge], - ), - ], - ); - }); }); } diff --git a/test/game/bloc/game_event_test.dart b/test/game/bloc/game_event_test.dart index c4de5792..68e6a2e7 100644 --- a/test/game/bloc/game_event_test.dart +++ b/test/game/bloc/game_event_test.dart @@ -97,17 +97,4 @@ void main() { ); }); }); - - group('SparkyTurboChargeActivated', () { - test('can be instantiated', () { - expect(const SparkyTurboChargeActivated(), isNotNull); - }); - - test('supports value equality', () { - expect( - SparkyTurboChargeActivated(), - equals(SparkyTurboChargeActivated()), - ); - }); - }); }