public void Should_Handle_Empty_List_Of_EventHandlers()
        {
            var aggregateEventHandler = new AggregateEventHandler <int[]>();

            aggregateEventHandler.OnEvent(new int[] { 7 }, 0L, true);
            aggregateEventHandler.OnStart();
            aggregateEventHandler.OnShutdown();
        }
        public void ShouldHandleEmptyListOfEventHandlers()
        {
            var aggregateEventHandler = new AggregateEventHandler <int[]>();

            aggregateEventHandler.OnEvent(new[] { 7 }, 0L, true);
            aggregateEventHandler.OnStart();
            aggregateEventHandler.OnShutdown();
        }
        public void Should_Call_OnShutdown_InSequence()
        {
            var aggregateEventHandler = new AggregateEventHandler <int[]>(_eh1, _eh2, _eh3);

            aggregateEventHandler.OnShutdown();

            AssertShutdownCalls(1, _eh1, _eh2, _eh3);
        }
Пример #4
0
        public void ShouldCallOnShutdown()
        {
            var aggregateEventHandler = new AggregateEventHandler <int[]>(_eventHandlerMock1.Object,
                                                                          _eventHandlerMock2.Object,
                                                                          _eventHandlerMock3.Object);

            _eventHandlerMock1.Setup(eh => eh.OnShutdown()).Verifiable("event handler 1 was not called");
            _eventHandlerMock2.Setup(eh => eh.OnShutdown()).Verifiable("event handler 2 was not called");
            _eventHandlerMock3.Setup(eh => eh.OnShutdown()).Verifiable("event handler 3 was not called");

            aggregateEventHandler.OnShutdown();

            _eventHandlerMock1.Verify();
            _eventHandlerMock2.Verify();
            _eventHandlerMock3.Verify();
        }