counterfeiter icon indicating copy to clipboard operation
counterfeiter copied to clipboard

Question: Asserting order of invocations?

Open crsimmons opened this issue 6 years ago • 1 comments

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.

crsimmons avatar Feb 12 '19 15:02 crsimmons

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

Possibly related to #106

dnephin avatar Feb 13 '19 00:02 dnephin