Esempio n. 1
0
        public void Should_throw_when_there_are_no_registered_message_handlers()
        {
            var receivedMessage = Helpers.Helpers.Serialize(new EventMessage());

            RegisterMessageType <EventMessage>();
            ReceiveMessage(receivedMessage);
            Assert.IsNotNull(ResultingException, "When no handlers are found and a message ends up in the endpoint, an exception should be thrown");
            Assert.That(ResultingException.GetBaseException().Message, Contains.Substring(typeof(EventMessage).ToString()), "The exception message should be meaningful and should inform the user the message type for which a handler could not be found.");
        }
Esempio n. 2
0
        public void Should_blow()
        {
            RegisterMessageType <TestMessage>();
            var receivedMessage = Helpers.Helpers.Serialize(new TestMessage());

            RegisterMessageHandlerType <HandlerThatReturns>();
            ReceiveMessage(receivedMessage);
            Assert.IsInstanceOf <InvalidOperationException>(ResultingException.GetBaseException());
        }