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 "class method vs. interface method" bug introduced by 162a543 #381

Merged
merged 2 commits into from
Jun 19, 2017

Conversation

stakx
Copy link
Contributor

@stakx stakx commented Jun 19, 2017

Commit 162a543 introduced a bug by handing over too many interfaces to Castle's ProxyGenerator.CreateClassProxy method. (The test case given in #141 contains a hint why this matters.) The intention behind that commit apparently was to enable mock.As<TInterface> even after mock.Object has already been called; something that wouldn't have been valid usage previously.

That change unfortunately also caused mocked classes' methods that implement an interface method to no longer be mocked correctly.

This commit fixes this problem by ensuring that the "internally implemented" interfaces are not explicitly passed to .CreateClassProxy (like it used to be done previously).

This fixes #132, #133, #141, #156, #157, #164, #175, #212, #315, and #331.

Commit 162a543 introduced a bug by handing over too many interfaces
to Castle's `ProxyGenerator.CreateClassProxy` method. The intention
behind that commit apparently was to enable `mock.As<TInterface>`
even after `mock.Object` has already been called.

That change unfortunately also caused mocked class' methods that im-
plement an interface method to no longer be mocked correctly.

This commit fixes this problem by ensuring that the "internally
implemented" interfaces are not explicitly passed to `.CreateClass-
Proxy` (like it used to be done previously).
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