public void Should_dispatch_message_to_default_handler_if_there_is_no_registered_handlers()
        {
            IMessage message = CreateMessage("unregisteredType");

            _subject.Dispatch(message);
            _defaultHandler.AssertWasCalled(h => h.Handle(message));
        }
        public void Should_dispatch_message_to_registered_handler()
        {
            const string messageType = "messageType";

            IMessageHandler messageHandler = CreateHandler(messageType);
            IMessage        message        = CreateMessage(messageType);

            _subject.Register(messageHandler);
            _subject.Dispatch(message);

            messageHandler.AssertWasCalled(h => h.Handle(message));
            _defaultHandler.AssertWasNotCalled(h => h.Handle(Arg <IMessage> .Is.Anything));
        }