public void GetMessageTypeByNameReturnsTypeOfRegisteredMessage()
        {
            IEnumerable <Type> MessageHandlerTypes()
            {
                return(new []
                {
                    typeof(HandlerA),
                    typeof(HandlerB),
                    typeof(NotAHandler)
                });
            }

            var sut = new MessageHandlerRegistry(MessageHandlerTypes);

            var messageType = sut.GetMessageTypeByName(typeof(MessageA).FullName);

            Assert.NotNull(messageType);
            Assert.Equal(typeof(MessageA), messageType);
        }
        public void GetMessageTypeByNameReturnsTypeMatchingMessageLabel()
        {
            IEnumerable <Type> MessageHandlerTypes()
            {
                return(new[]
                {
                    typeof(HandlerA),
                    typeof(HandlerB),
                    typeof(NotAHandler),
                    typeof(HandlerWithLabelAttribute)
                });
            }

            var sut = new MessageHandlerRegistry(MessageHandlerTypes);

            var messageType = sut.GetMessageTypeByName("A.Custom.Message.Label");

            Assert.NotNull(messageType);
            Assert.Equal(typeof(MessageWithLabelAttribute), messageType);
        }