public async Task ItShouldNotFailWhenThereAreNoSubscribers() { var counter = new PublishedEventsCounter(); var container = AutofacConfiguration.CreateContainer(new List <Assembly> { GetType().Assembly }, c => { c.Register(_ => counter); }); var dispatcher = container.Resolve <IDomainEventDispatcher>(); var aggregate = new MyAggreagte(); aggregate.DoSomethingWhichIsNotBeingHanlded(); await dispatcher.Dispatch(aggregate); Assert.Equal(0, counter.Count); }
public FirstHandler(PublishedEventsCounter counter) { _counter = counter; }
public SecondHandler(PublishedEventsCounter counter) { _counter = counter; }