Skip to content
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

Question: Asserting order of invocations? #113

Open
crsimmons opened this issue Feb 12, 2019 · 1 comment
Open

Question: Asserting order of invocations? #113

crsimmons opened this issue Feb 12, 2019 · 1 comment

Comments

@crsimmons
Copy link

Thanks for making Counterfeiter!

Is it possible to assert on the order of invocations? We have some complicated legacy code, and want to make sure that collaborators of the function under test are invoked in the right order.

Is there any way of doing this through Counterfeiter without providing stubs for every function we care about? We're currently appending messages to an array on each invocation so we can assert the order, but it's a bit clunky.

@dnephin
Copy link
Contributor

dnephin commented Feb 13, 2019

The generated fakes already store the list of calls, and they can be retrieved with Fake.Invocations().

Possibly related to #106

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants