public void Verify_handler_of_derived_class() { var listOfHandlers = sut.GetAllHandlerFor(typeof(MyDerivedDomainEvent)); MyDerivedDomainEvent evtderived = new MyDerivedDomainEvent(); foreach (var handler in listOfHandlers) { handler.Invoke(evtderived); } evtderived.CallCountSpecific.Should().Be.EqualTo(1); }
public void Catch_derived_event(MyDerivedDomainEvent evt) { evt.CallCountSpecific++; }
public void Verify_we_can_create_a_catch_event_from_base_type() { var listOfHandlers = sut.GetAllHandlerFor(typeof(MyBaseDomainEvent)); MyBaseDomainEvent evtbase = new MyBaseDomainEvent(); foreach (var handler in listOfHandlers) { handler.Invoke(evtbase); } evtbase.CallCount.Should().Be.EqualTo(1); MyDerivedDomainEvent evtderived = new MyDerivedDomainEvent(); foreach (var handler in listOfHandlers) { handler.Invoke(evtderived); } evtderived.CallCount.Should().Be.EqualTo(1); }