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

Make MockFactory.VerifyMocks do what it says it does #691

Merged
merged 3 commits into from
Sep 8, 2018

Conversation

stakx
Copy link
Contributor

@stakx stakx commented Sep 8, 2018

The XML documentation comment for MockFactory.VerifyMocks(Action<Mock> verifyAction) states the purpose of that method as follows:

Invokes verifyAction for each mock in [the repository], and accumulates the resulting verification exceptions that might be thrown from the action.

However this is not what the method has been doing up until now. It hasn't accumulated any verification errors, but only those caused by unmatched setups (i.e. those exceptions thrown by Verify and VerifyAll).

This PR makes the VerifyMocks method adhere to its own stated purpose by cleaning up MockException aggregation a little. This also allows us to reuse VerifyMocks in MockFactory.VerifyNoOtherCalls.

@stakx
Copy link
Contributor Author

stakx commented Sep 8, 2018

/cc @BlythMeister — you were right about this. You proposed very similar changes a short while ago, which I turned down at the time. I'd like to apologize for that. I've only just realised now that I am going to need clean MockException aggregation anyway for an upcoming refactoring.

@BlythMeister
Copy link
Contributor

@stakx no need to apologize! Just glad that my change made you look at this code 👍

@stakx stakx merged commit 5918861 into devlooped:master Sep 8, 2018
@stakx stakx deleted the mockfactory-verifymocks branch September 8, 2018 09:14
@stakx stakx added this to the 4.10.0 milestone Sep 8, 2018
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.

None yet

2 participants