-
Notifications
You must be signed in to change notification settings - Fork 175
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
Cannot setup Return as separate statement #202
Comments
Ok you can do this:
No reference index no more. So this makes this issue a lot less annoying. |
I have a similar problem but need to programmatically build the return values from different sources. Sadly it seems that Fakeit has implemented the The solution proposed in the last comment really only works if all the return values are known at the time the Ideally I'd like an API that does (NB: this is over simplified, in reality the progress calls are spread over different parts of the test setup (I'm using Cucumber step_definitions, each providing additional values to describe a sequence).
|
Wondering if a new chain is ever really useful? |
In general you shouldn't use My guess is it's a deep subtle flaw. Might have a deep look if/when I have time. |
In this example "setup.Return(1);" crashes with read access violation.
It would be quite useful to allow calling Return as a separate statement. Then you can have multiple return values in a vector and do:
Currently I have to resort to:
I usually set up my mocks in helper methods to share setup code between tests, so that then becomes:
as you can see there is an additional index reference parameter that you need to keep track of, which is not convenient.
The text was updated successfully, but these errors were encountered: