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 for issue #228: Events not raised on mocked type with multiple interfaces #288

Merged
merged 1 commit into from
Sep 20, 2016

Conversation

bradreimer
Copy link
Contributor

The ImplementedInterfaces list on Mock contains the public interfaces of our mocked type, the internally defined IMocked type, and anything else added to the mock via calls to As. When looking for events, only the last of these (and the concrete mocked type) should be looked at.

Previously the assumption was that ImplementedInterfaces' first entry was the IMocked type, and that the rest were always needed. This meant the first entry in that list could be skipped, and the rest were always taken. After 162a543 added more interfaces to the list, however, this logic needs to change to count all internally implemented entries in the list and skip them all.

Fixing this will fix #228 which was caused when the EventInfo from an interface was intercepted, but the EventInfo from the underlying concrete type was actually expected.

@kzu
Copy link
Member

kzu commented Sep 20, 2016

Awesome instantly merge-able PR. Thanks!!!

@kzu kzu merged commit cd67f5c into devlooped:master Sep 20, 2016
@bradreimer bradreimer deleted the issue228 branch September 20, 2016 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants