We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Following the example for mockito in Java:
mockito
when(mockFoo.someMethod()) .thenReturn(obj1) .thenThrow(new IllegalArgumentException()) .thenReturn(obj2, obj3);
Is it possible to have a feature that lets us return different values each time a mock method is called?
Perhaps something that can be chained as above:
await mockContract.mock.someMethod .returns(someValue) .reverts() .returns(someOtherValue)
So the first returns is called when the mock method is called for the 1st time, the reverts the second time and so on.
returns
reverts
The text was updated successfully, but these errors were encountered:
Currently it is not implemented, but it's definitely a good feature to have.
Sorry, something went wrong.
Implemented in #816
No branches or pull requests
Following the example for
mockito
in Java:Is it possible to have a feature that lets us return different values each time a mock method is called?
Perhaps something that can be chained as above:
So the first
returns
is called when the mock method is called for the 1st time, thereverts
the second time and so on.The text was updated successfully, but these errors were encountered: