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);
        }