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_OnStart_InSequence()
        {
            var aggregateEventHandler = new AggregateEventHandler <int[]>(_eh1, _eh2, _eh3);

            aggregateEventHandler.OnStart();

            AssertStartCalls(1, _eh1, _eh2, _eh3);
        }
Ejemplo n.º 4
0
        public void ShouldCallOnStart()
        {
            var aggregateEventHandler = new AggregateEventHandler <int[]>(_eventHandlerMock1.Object,
                                                                          _eventHandlerMock2.Object,
                                                                          _eventHandlerMock3.Object);

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

            aggregateEventHandler.OnStart();

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