-
-
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
Calling the same method with the same object does not differentiate the delta at call time #531
Comments
Moq does not capture whole object graphs for each proxy invocation (and that is not going to change because the memory burden would likely outweigh the rare advantages—imagine someone mocking an Entity Framework context and Moq trying to capture the context's complete state!). At call time, the actual argument values are captured, nothing else. Therefore, since A few options:
|
Understandable, especially considering larger, complex models, like a EF context. Thanks for detailed respone! |
You're welcome! :) |
Considering the following unit test, where the subject calls the same method with the same object twice, I expect that you can verify that the method is called twice, and being able to distinguish the two calls.
The premise is that you can't go into and make changes to the house, if the doors are locked. If the doors are locked you first have to open them before making changes.
It seems that verifying method calls just keep the object reference and don't make a copy of the object at the time of the method call. I expect the first two assertions to be verified, differentiating the changes, while it actually verifies the last assertion.
The text was updated successfully, but these errors were encountered: