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 mocking of non-virtual methods via interface #387

Merged
merged 3 commits into from
Jun 21, 2017

Conversation

stakx
Copy link
Contributor

@stakx stakx commented Jun 21, 2017

PR #381 (specifically, commit 0e3eaf3) broke the ability of mocking a non-virtual method if it is set up and called via an interface (mock.As<TInterface>()). This commit restores that feature.

This should fix #383.

Commit 0e3eaf3 broke the ability of mocking a non-virtual method if
it is set up and called via an interface (`mock.As<TInterface>()`).
This commit restores that feature.
In the preceding commit, some logic was added that might both remove
an item from the `ImplementedInterfaces` list and decrement another
variable (`InternallyImplementedInterfaceCount`). Both should ideally
happen as an atomic operation.

It turns out that the removal is actually irrelevant, and the method
`Mock.As<TInterface>` can be simplified somewhat.
@stakx stakx merged commit f001f6d into devlooped:develop Jun 21, 2017
@stakx stakx deleted the as-interface-bug branch June 21, 2017 16:26
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