-
-
Notifications
You must be signed in to change notification settings - Fork 794
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
Events not working with CallBase = true depending on order interfaces are inherited. C : IA, IB behaves different than C : IB, IA #228
Comments
IIRC, if you manually inherit a class with just virtual events but no On Wed, Dec 16, 2015, 3:55 PM Patrick Quirk notifications@github.com
|
Could you update the issue title and provide a better description then? Thanks On Thu, Dec 17, 2015, 12:36 AM seanhalliday notifications@github.com
|
…ype implements multiple interfaces
public interface IFoo
{
event EventHandler Foo;
}
public interface IBar
{
event EventHandler Bar;
}
// reverse the order of IFoo and IBar will change the results of the test
public class FooBar : IFoo, IBar
{
public event EventHandler Foo;
public event EventHandler Bar;
public void RaiseEvents()
{
if (Foo != null)
Foo(this, EventArgs.Empty);
if (Bar != null)
Bar(this, EventArgs.Empty);
}
}
[TestClass]
public class MoqTest
{
[TestMethod]
public void MultipleInterfacesWithEvents()
{
var mock = new Mock<FooBar>() { CallBase = true };
IFoo foo = mock.Object;
IBar bar = mock.Object;
}
The text was updated successfully, but these errors were encountered: