-
-
Notifications
You must be signed in to change notification settings - Fork 794
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
Mock.HasSetup(mock, x => x.Foo) #391
Comments
Was there a specific reason why you couldn't just define the default values first, then perform the setups (to override the default values)? |
@JohanLarsson - you mentioned in a different place that this was more of a question. Is there anything to be done here, still, or should we close this? Let me quickly summarise a thought that I've had about this request. Different people might want different things from such an overload. People might expect that this new method answers the following questions for them:
I feel that we should add this feature lightly. Unless of course there's actually a frequent use case that cannot be easily solved otherwise—thus my original question in the message above this one. |
I'll close it, hacked it with reflection. |
I implemented this with reflection from the outside. What do you think about a PR adding this?
The use case was when using a container in tests and setting up default values. I only wanted to set up the default value if there was no prior setup. It was all pretty nasty :)
The text was updated successfully, but these errors were encountered: