#5 Fire inherited event

V1.0
open-fixed
Urs Enzler
None
5
2009-02-18
2009-02-17
Urs Enzler
No

Hallo,

I have tried to fire an event on a derived interface. This leads to an error saying: Event with name ... does not exist on ... .

Am I doing something wrong? Here is the code to reproduce the error:

[TestFixture]
public class TestClass
{
public interface IFoo
{
event EventHandler eve;
}

public interface IFoo2 : IFoo
{

}

[Test]
public void Test1()
{
Mockery mockery = new Mockery();
IFoo2 f2 = mockery.NewMock<IFoo2>();
Fire.Event("eve").On(f2).With(this, EventArgs.Empty);
}
}

Regards,
slompf

Discussion

  • Urs Enzler
    Urs Enzler
    2009-02-17

    results in:

    System.ArgumentException: Event with name Event does not exist on type NMock2.BugReproduction.FireInheritedEvent_2609020+IDerived.
    Parameter name: eventName

     
  • Urs Enzler
    Urs Enzler
    2009-02-17

    • status: open --> open-accepted
     
  • Urs Enzler
    Urs Enzler
    2009-02-18

    fixed on trunk, merged to class mock branch

     
  • Urs Enzler
    Urs Enzler
    2009-02-18

    • status: open-accepted --> open-fixed