-
-
Notifications
You must be signed in to change notification settings - Fork 798
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
CallBase() is missing on ISetup<T> #615
Comments
@Nikkelmann - I tend to agree that We currently have a freeze on Moq 4's API while Moq 5 is being made ready for publication so we cannot proceed on this right away. I'll check with @kzu whether we can add this anyway (since it appears to be a fairly obvious omission). |
|
No opinions on this one? If not, I'll put together a pull request on my immediate ideas. |
@Tragedian, sorry for being non-responsive. I haven't quite found the time yet to review this properly. The thing is, there are several things that currently appear to be wrong in the |
No rush. Just want to make sure we're making the best changes. |
@Tragedian: I've been looking at Moq's fluent API interfaces last weekend, and things look rather messy. My current suggestion would be that we do the following:
Alternatively, if we want to allow Either of these options should be good enough for the next 4.9.1 release and not cause any breaking changes. I am planning to clean up & straighten out the fluent API interfaces to give them a consistent and more readily understandable structure, but since that will introduce binary breaking changes I'd like to hold that off until 4.10.0. |
Update: Please ignore this comment, I made a mistake. See #615 (comment) below. @Nikkelmann - I've finally found some time to look into the missing
I'm undecided which way to go. (1) bears the risk of the Moq team receiving lots of "bug" reports; (2) is the right solution from a purely technical point of view, but bears the risk of breaking user code. (3) is an easy way out, at the cost of avoidable API complexity. And (4) is another easy way out with the disadvantage of an incomplete API. Any opinions on these four options, or do you see any other options? P.S.: I'm going to default to "do nothing" (4) unless we find a good solution here. |
@Nikkelmann - please ignore the above comment. Turns out that the tests were written incorrectly, mock-level |
@Nikkelmann, @Tragedian - I've just pushed Moq 4.10.0 (which includes |
I have a service method that calls a bunch of other methods in the service.
In this case I want to make a partial mock without using
mock.CallBase = true;
since I'm only interested in testing this one method in this unit test (I will have a unit test for each separate method).Specifically in my case I want to verify that Method2ThatReturnsStuff was given the data from Method1ThatReturnsStuff:
As you can see CallBase() is missing when the return type is void.
The text was updated successfully, but these errors were encountered: