refactor: removed SparkyTurboChargeActivated event (#401)

pull/358/head
Alejandro Santiago 3 years ago committed by alestiago
parent 0b9d2131d8
commit c305a09980

@ -12,7 +12,6 @@ class GameBloc extends Bloc<GameEvent, GameState> {
on<Scored>(_onScored); on<Scored>(_onScored);
on<MultiplierIncreased>(_onIncreasedMultiplier); on<MultiplierIncreased>(_onIncreasedMultiplier);
on<BonusActivated>(_onBonusActivated); on<BonusActivated>(_onBonusActivated);
on<SparkyTurboChargeActivated>(_onSparkyTurboChargeActivated);
on<GameOver>(_onGameOver); on<GameOver>(_onGameOver);
on<GameStarted>(_onGameStarted); on<GameStarted>(_onGameStarted);
} }
@ -65,18 +64,4 @@ class GameBloc extends Bloc<GameEvent, GameState> {
), ),
); );
} }
Future<void> _onSparkyTurboChargeActivated(
SparkyTurboChargeActivated event,
Emitter emit,
) async {
emit(
state.copyWith(
bonusHistory: [
...state.bonusHistory,
GameBonus.sparkyTurboCharge,
],
),
);
}
} }

@ -40,13 +40,6 @@ class BonusActivated extends GameEvent {
List<Object?> get props => [bonus]; List<Object?> get props => [bonus];
} }
class SparkyTurboChargeActivated extends GameEvent {
const SparkyTurboChargeActivated();
@override
List<Object?> get props => [];
}
/// {@template multiplier_increased_game_event} /// {@template multiplier_increased_game_event}
/// Added when a multiplier is gained. /// Added when a multiplier is gained.
/// {@endtemplate} /// {@endtemplate}

@ -279,21 +279,5 @@ void main() {
); );
}, },
); );
group('SparkyTurboChargeActivated', () {
blocTest<GameBloc, GameState>(
'adds game bonus',
build: GameBloc.new,
act: (bloc) => bloc..add(const SparkyTurboChargeActivated()),
expect: () => [
isA<GameState>()
..having(
(state) => state.bonusHistory,
'bonusHistory',
[GameBonus.sparkyTurboCharge],
),
],
);
});
}); });
} }

@ -97,17 +97,4 @@ void main() {
); );
}); });
}); });
group('SparkyTurboChargeActivated', () {
test('can be instantiated', () {
expect(const SparkyTurboChargeActivated(), isNotNull);
});
test('supports value equality', () {
expect(
SparkyTurboChargeActivated(),
equals(SparkyTurboChargeActivated()),
);
});
});
} }

Loading…
Cancel
Save