-
-
Notifications
You must be signed in to change notification settings - Fork 802
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
SetupAllProperties overrides previous setups of read-only properties #196
Comments
Nice repro 👍 It seems... unexpected... that |
Please, fix this. |
We'll gladly accept a PR ;) |
Is this related to #275? |
@david-banister: Yes, this is related to #275, in the sense that it has the same underlying cause (as mentioned in #162). @dcastro: While I would judge the new behaviour to be a bug in the context of #162 and #275, I think it should actually be the correct behaviour in your issue's scenario:
The new behaviour was introduced by #137 to fix a regression that was reportedly introduced by this old Google Code issue 199. And this fix does make sense: A method called If we have two setups that affect the same property, I would expect the last setup to win / override the former setup. Viewed from that perspective, it can be argued that what needs to change in this particular scenario is the order in which you perform your setups: First, the one with the broader effect to set up a basic default: That is why I tend to see this issue as a "won't fix". Any opinions? |
I am closing this issue for the time being, for three reasons:
If someone would like to bring forward other arguments why this should be fixed nevertheless, please do so... we can always reopen this issue. |
Repro
Passes with Moq 4.2.1409.1722 or lower
Fails with Moq 4.2.1502.911 or greater
Problem
It appears that, before Moq 4.2.1502.911, the visible side-effects of
SetupAllProperties
were:Since 4.2.1502.911, SetupAllProperties now does this:
The text was updated successfully, but these errors were encountered: