public void AttachEventCorrectly() { var obj = new TestEventClass(); var wrapper = new ImplBaseTester(obj); wrapper.AddEvent <EventArgs>(nameof(TestEventClass.Event), nameof(ImplBaseTester.HandleEvent)); obj.FireEvent(); Assert.IsTrue(wrapper.EventCalled); }
public void DetachEventCorrectly() { var obj = new TestEventClass(); var wrapper = new ImplBaseTester(obj); obj.Event += wrapper.HandleEvent; wrapper.RemoveEvent <EventArgs>(nameof(TestEventClass.Event), nameof(ImplBaseTester.HandleEvent)); obj.FireEvent(); Assert.IsFalse(wrapper.EventCalled); }