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

Remove leaked MockVerificationException and catch-throw-recatch cycle during verification #511

Merged
merged 5 commits into from Nov 3, 2017

Conversation

stakx
Copy link
Contributor

@stakx stakx commented Nov 2, 2017

Closes #507.


foreach (var mock in mocks)
{
try
{
verifyAction(mock);
}
catch (MockVerificationException mve)
catch (MockException ex) when (ex.Error is UnmatchedSetups failure)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately the throw-catch pattern cannot be replaced with a full try pattern due to this method's signature and the fact that it's protected. It would have to be marked as [Obsolete].

@stakx stakx force-pushed the mockverificationexception branch 2 times, most recently from 917a14c to addc2d8 Compare November 3, 2017 18:15
Instead of only being able to hold a instance of `UnmatchedSetups`,
make `MockException` more general so it can hold different kinds of
error objects. Towards that end, introduce a new `IError` interface.
@stakx stakx merged commit 354840d into devlooped:develop Nov 3, 2017
@stakx stakx deleted the mockverificationexception branch November 3, 2017 18:21
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

1 participant