You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior
I would have expected that verify(() => mockProviderB.increment()).called(1); should work fine.
What I get instead is the following:
It looks as if mockProviderB was never called ...
However, when I look at the debug window, I get the following:
So, the mock's implementation was called. It seems as if the override works for the invocation but not for the verify statement.
Can you help me whats wrong in my code? Remi from riverpod told me that I'm using mocktail wrong. So how should I implement a test that checks whether notifier A calls notifier B when only the internal state of the notifier is change and not the public model?
The text was updated successfully, but these errors were encountered:
Describe the bug
I want to write an unit test for a method that is part of a notifier (Provider A). I'll try to explain with a very simple example:
As you can see, increment calls another notifier's method (ProviderB -> increment).
I would like to write a test now that verifies if Provider B's method increment was call once.
To Reproduce
Reproducdable by the code above.
Expected behavior
I would have expected that
verify(() => mockProviderB.increment()).called(1);
should work fine.What I get instead is the following:
It looks as if mockProviderB was never called ...
However, when I look at the debug window, I get the following:
So, the mock's implementation was called. It seems as if the override works for the invocation but not for the verify statement.
Can you help me whats wrong in my code? Remi from riverpod told me that I'm using mocktail wrong. So how should I implement a test that checks whether notifier A calls notifier B when only the internal state of the notifier is change and not the public model?
The text was updated successfully, but these errors were encountered: