public void ShouldReturnSingleMessageType()
        {
            var componentUnderTest = new MessageHandlerTypesIndex(new[] { typeof(TestMessageAHandler) });

             var result = componentUnderTest.GetAllMessageTypes();

             Assert.That(result, Is.EquivalentTo(new[] { typeof(TestMessageA) }));
        }
        public void ShouldReturnMessageTypeIfHandlerHasBeenIndexed()
        {
            var componentUnderTest = new MessageHandlerTypesIndex(new[] { typeof(TestMessageAHandler) });

             var result = componentUnderTest.GetMessageHanderTypeFrom(typeof(TestMessageA));

             Assert.That(result, Is.SameAs(typeof(TestMessageAHandler)));
        }
        public void ShouldReturnNullIfHandlerHasNotBeenIndexed()
        {
            var componentUnderTest = new MessageHandlerTypesIndex(new[] { typeof(TestMessageAHandler) });

             var result = componentUnderTest.GetMessageHanderTypeFrom(typeof(TestMessageB));

             Assert.That(result, Is.Null);
        }
        public void ShouldReturnMessageTypeForSecondHandler()
        {
            var componentUnderTest = new MessageHandlerTypesIndex(new[] { typeof(TestMessageAHandler), typeof(TestMessageBHandler) });

             var result = componentUnderTest.GetMessageHanderTypeFrom(typeof(TestMessageB));

             Assert.That(result, Is.SameAs(typeof(TestMessageBHandler)));
        }
        public void ImplementIMessageHandlerInvoker()
        {
            var componentUnderTest = new MessageHandlerTypesIndex(new[] { typeof(TestMessageAHandler) });

             Assert.That(componentUnderTest, Is.InstanceOf<IMessageHandlerTypesIndex>());
        }