Exemplo n.º 1
0
        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());
        }
Exemplo n.º 2
0
        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);
        }