Skip to content
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

Fix using Mock.Of on objects having properties with private setters #19

Merged
merged 1 commit into from
Jun 21, 2012

Conversation

yorah
Copy link
Contributor

@yorah yorah commented Jun 20, 2012

Fixes #14

I think my fix is valid (I'm basically converting to SetupGet when the setter is private).

@danielkzu the problem was that in MockSetupsBuilder, the property.DeclaringType is the real type (Moq.Tests.Foo), whereas in SetupPropery, the type on which we work is the FooProxy. I think there is something going on in DynamicProxy2 (something like: when the setter of a property is private, it's not proxied in the proxy class).

@kzu
Copy link
Member

kzu commented Jun 21, 2012

Great clean fix. Thanks!

kzu added a commit that referenced this pull request Jun 21, 2012
Fix using Mock.Of on objects having properties with private setters
@kzu kzu merged commit 5731885 into devlooped:master Jun 21, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug using Mock.Of on objects with virtual properties.
2 participants