New issue
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
Assert call order? #684
Comments
why do you need such a possibility? |
How do you check that a mock's methods were called in a specific order? Sometimes your test is only correct if there is an ordering to events. |
IMO you should check the output of the function but not how it works internally. It may lead to testing implementation which is very hard to maintain. |
IMO there are cases to enforce order. i.e if you mock a mutex, you better check that Lock was always called before Unlock. We can have a simple implementation where the mock has an "assertExpectationsInOrder" true/false flag that can be set before any expectations are added. |
If you take a simple example like |
This is covered under #741 |
Hi, great project. Is there any way to assert the order that methods were called? What's the best way to do it? I'm assuming it is iterating over the mock's calls, and doing something, but I am imagining that the "something" means rewriting a lot of the argument checking logic by hand :)
Thanks!
The text was updated successfully, but these errors were encountered: