コード例 #1
0
        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);
        }
コード例 #2
0
 public FirstHandler(PublishedEventsCounter counter)
 {
     _counter = counter;
 }
コード例 #3
0
 public SecondHandler(PublishedEventsCounter counter)
 {
     _counter = counter;
 }