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
AutoConfiguredMoqCustomization and read-only properties #434
Comments
Shouldn't we raise an issue to Moq? This looks like a Moq-related issue to me. I could be wrong though... |
@moodmosaic Agreed - done so here: devlooped/moq#196 |
@dcastro 👍 |
As usual an exemplary bug report, @dcastro 👍
Unfortunately, I'd tend to agree with this assessment, but let's give the Moq team a couple of days to prove us wrong. If, after a couple of days, nothing has happened in Moq, I think that we should address the issue here, if we can (and it doesn't pull us in the wrong direction). |
While I've added the label bug to this issue, I haven't added the label jump in. This shouldn't be taken as an indication that none except the 'core team' must address this defect. The actual reason I didn't add the jump in tag is that I'm not sure whether or not this issue is easy to tackle for newcomers. @dcastro, you know this part of the code base batter than I do. Do you think we should add the jump in tag? |
Thanks guys! @ploeh Well, I'm not sure what the criteria is for adding the jump in tag, so I can only speak as to how straightforward the solution might be. And I can't think of a straightforward solution, so far. My first thought was to switch the order of the setups - (1) call So, I think this deserves a bit of thought. Of course, I can give this a try myself, if we don't get a response from the Moq team soon, as you said. |
For the record, the jump in tag is described here. |
@dcastro Thanks for mentioning my stackoverflow's question and your support |
Closing this due to inactivity. |
Sorry for bringing this up, but is there any workaround? It doesn't seems that Moq team will fix this anytime soon. |
Still no work around? The codebase I'm currently on is full of get-only properties on interfaces so could really use this |
@MichaelLogutov, @EsbenSkovPedersen, have you considered sending Moq a pull request addressing the underlying issue? |
@ploeh fair enough. I'll see what I can do. Btw thanks for an awesome library. Saves us so much time. |
The issue has since been closed by the Moq team and described as their desired behaviour. |
@nphmuller Thanks for the follow up. That means that we should fix this on our side as they will not change the behavior. I'm not too familiar with Moq and don't use it. Therefore, let's see whether somebody with knowledge could fix this. |
This issue relates to the problem described here: AutoConfiguredMoqCustomization and unsettable properties
Repro
Passes with Moq 4.2.1409.1722 or lower
Fails with Moq 4.2.1502.911 or greater
Background
The setup of
Interface
in the repro is roughly equivalent to these 3 steps: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:I see this as a breaking change introduced by Moq.
Whether it was intentional or not, I don't know - but even if it is a bug, judging from past experience, I don't think it'll be addressed anytime soon since this is kind of an edge case.
Should we address this issue and provide a fix? (e.g., by reordering our setup steps)
The text was updated successfully, but these errors were encountered: