I have button that when pressed is add a event to bloc like this :
ElevatedButton(
onPressed: () {
context.read<MyBloc>().add(MyEvent());
},
child: ...,
);
And then, I want to create a widget test scenario that can verify if bloc adding true event. I created mock class like this :
class MockMyBloc extends MockBloc<MyEvent, MyState>
implements MyBloc {}
class FakeMyEvent extends Fake implements MyEvent {}
class FakeMyState extends Fake implements MyState {}
However, when I verify (using mocktail) the addition of the event to the bloc, the result is "No matching calls"
verify(() => mockMyBloc.add(MyEvent())); // No matching calls
How I can verify bloc is adding true event? Thank you in advance!