public async Task Should_Invoke_LocalEventHandler_With_MyEventData() { var localHandler = new MyLocalEventHandler(); var eventData = new MyEventData(); await _eventHandlerInvoker.InvokeAsync(localHandler, eventData, eventData.GetType()); localHandler.MyEventDataCount.ShouldBe(2); localHandler.EntityChangedEventDataCount.ShouldBe(0); localHandler.EntityChangedEventDataCount.ShouldBe(0); }
public async Task Should_Invoke_LocalEventHandler_Created_And_Changed_Once() { var localHandler = new MyLocalEventHandler(); var eventData = new EntityCreatedEventData <MyEntity>(new MyEntity()); await _eventHandlerInvoker.InvokeAsync(localHandler, eventData, eventData.GetType()); await _eventHandlerInvoker.InvokeAsync(localHandler, eventData, typeof(EntityChangedEventData <MyEntity>)); localHandler.MyEventDataCount.ShouldBe(0); localHandler.EntityChangedEventDataCount.ShouldBe(1); localHandler.EntityChangedEventDataCount.ShouldBe(1); }