-
-
Notifications
You must be signed in to change notification settings - Fork 803
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
The result of setting up methods in an hierarchy of interfaces depends on the order by which they're set up #131
Comments
I found this bug independently today working on an answer for this question on StackOverflow. Hopefully what I found can help. |
Related: #22, which is also about shadowed members. It appears that it's not entirely clear what Moq does / should do in such cases. |
@pjquirk, well spotted, this line of code, like you mentioned in your answer on Stack Overflow, indeed seems to be the reason for this peculiar behavior. Thanks for helping to identify the problem's cause! I'll look into this some more tomorrow. My current guess is that it should be possible to first attempt to find a precise match, and only if there is none (or several equally good matches), fall back to the current |
This should be fixed in the next release of Moq (version >4.7.63). |
Thanks for the fix @stakx, and glad I could be of some use! |
Test Types:
Reproduce bug:
If I change the order of the setups, so that
Derived.Method
is configured last, the program now prints "a", "b", "c" as expected and the tests pass.The text was updated successfully, but these errors were encountered: