I'm trying to use verifyNever
to test that a function should not be called in a specific case, but it seems that doesn't work. Moreover, I've seen from:How to verify to call or not to call a method that to verify that something has been called you have to await
for that, but how can I await
for something that never happens? For example:
test('when create, should not call destroy', (){
when(_mockCreateCharacter(name, surname)).thenThrow(exception);
_bloc.dispatch(Create(name,surname));
verifyNever(_bloc.destroy());
});
Aucun commentaire:
Enregistrer un commentaire