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
Question: setup nested dependencies mocks with AutoMoqCustomization #608
Comments
The If you want the mock's members to be set up, consider using the There are two limitations. It doesn't setup:
More info at the bottom of the cheat sheet. |
Thanks for fast response! I tried |
Actually, nevermind. It does setup get-only properties too, my bad. I also remember a bug in Moq that interfered with AutoMoq, making it unable to setup get-only properties. At least back when I looked into this, you had to use Moq version 4.2.1409.1722 or lower (details at #434). Maybe the bug has been fixed in newer version of Moq, I'm not sure. |
Tried the highest Moq version that is lower than 4.2.1409.1722 and you're correct, it works for get-only properties as well. The Moq bug wasn't fixed in a newer version, since I tried it with latest. Thank you very much for your help |
Duplicates http://stackoverflow.com/q/36656741/126014 |
I've tried using the
AutoMoqCustomization
to auto-mock an object graph with nested dependencies and results are not as I expected. Here's the test code, can someone please tell me why after freezing aMock<IObject>
there's a situation where anotherIObject
created by Moq is created by the fixture?The text was updated successfully, but these errors were encountered: