public void ProcessEvents()
 {
     using (_ctx = new OrderContext())
     {
         int lastEventNumber = GetLastEventNumber();
         _eventStreamListener.ReadAndHandleLatestEvents <OrderAggregate>(lastEventNumber);
     }
 }
예제 #2
0
        public void When_HandlerIsRegistered_CallsHandler()
        {
            var state      = 0;
            var eventStore = new TestEventStore();

            eventStore.AddPreviousEvents(new List <Tuple <Type, IEvent> > {
                new Tuple <Type, IEvent>(typeof(AggregateBase), new SomeEvent(Guid.NewGuid()))
            });

            var eventListener = new EventStreamListener(eventStore);

            eventListener.RegisterEventHandler <SomeEvent>(evt => { state = 2; });

            eventListener.ReadAndHandleLatestEvents <AggregateBase>(0);

            Assert.True(state == 2);
        }
예제 #3
0
        public void ProcessEvents()
        {
            int lastEventNumber = GetLastEventNumber();

            _eventStreamListener.ReadAndHandleLatestEvents(lastEventNumber);
        }