public void when_dispatching_an_event_with_registered_handler_then_invokes_handler()
        {
            var @event = new EventA();

            this.sut.DispatchMessage(@event, "message", "correlation", "");

            this.handlerMock.As <IEventHandler <EventA> >().Verify(h => h.Handle(@event), Times.Once());
        }
        public void when_dispatching_an_event_with_registered_handler_then_invokes_handler()
        {
            var @event = new EventA();

            this.sut.DispatchMessage(@event, "message", "correlation", "");

            this.handlerMock.As <IEnvelopedEventHandler <EventA> >()
            .Verify(
                h => h.Handle(It.Is <Envelope <EventA> >(e => e.Body == @event && e.MessageId == "message" && e.CorrelationId == "correlation")),
                Times.Once());
        }
        public void when_dispatching_an_event_with_registered_handler_then_invokes_handler()
        {
            var @event = new EventA();

            this.sut.DispatchMessage(@event, "message", "correlation", "");

            this.handlerMock.As<IEventHandler<EventA>>().Verify(h => h.Handle(@event), Times.Once());
        }
        public void when_dispatching_an_event_with_multiple_registered_handlers_then_invokes_handlers()
        {
            var @event = new EventA();

            this.sut.DispatchMessage(@event, "message", "correlation", "");

            this.handler1Mock.As<IEnvelopedEventHandler<EventA>>()
                .Verify(
                    h => h.Handle(It.Is<Envelope<EventA>>(e => e.Body == @event && e.MessageId == "message" && e.CorrelationId == "correlation")),
                    Times.Once());
            this.handler2Mock.As<IEventHandler<EventA>>().Verify(h => h.Handle(@event), Times.Once());
        }