public void SetupBeforeEachTest()
        {
            this.messageHandlerTypesIndexFactory = A.Fake<IMessageHandlerTypesIndexFactory>();
             this.messageHandlerInvokerFactory = A.Fake<IMessageHandlerInvokerFactory>();
             this.messageHandlerTypesIndex = A.Fake<IMessageHandlerTypesIndex>();
             this.configuration = A.Fake<IConfiguration>();
             this.messageServiceExchange = A.Fake<IMessageServiceExchange>();

             A.CallTo(() => this.messageHandlerTypesIndexFactory.Create(A<Type[]>._)).Returns(this.messageHandlerTypesIndex);
             A.CallTo(() => this.messageHandlerTypesIndex.GetAllMessageTypes()).Returns(new[] { typeof(object) });

             A.CallTo(() => this.messageHandlerTypesIndexFactory.Create(A<Type[]>._)).Returns(this.messageHandlerTypesIndex);
        }
        public InMemoryMessageListener(
         Type messageHandlerType,
         IMessageHandlerTypesIndexFactory messageHandlerTypesIndexFactory,
         IMessageHandlerInvokerFactory messageHandlerInvokerFactory,
         IConfiguration configuration,
         IMessageServiceExchange messageServiceExchange)
        {
            this.configuration = configuration;
             this.messageServiceExchange = messageServiceExchange;

             var messageHandlerTypesIndex = messageHandlerTypesIndexFactory.Create(new[] { messageHandlerType });
             this.messageHandlerInvoker = messageHandlerInvokerFactory.CreateAggregate(messageHandlerTypesIndex);
             this.messageType = messageHandlerTypesIndex.GetAllMessageTypes().Single();
        }
        public void SetupBeforeEachTest()
        {
            this.messageHandlerTypesIndexFactory = A.Fake<IMessageHandlerTypesIndexFactory>();
             this.messageHandlerInvokerFactory = A.Fake<IMessageHandlerInvokerFactory>();
             this.messageHandlerTypesIndex = A.Fake<IMessageHandlerTypesIndex>();
             this.messageHandlerInvoker = A.Fake<IMessageHandlerInvoker>();
             this.configuration = A.Fake<IConfiguration>();
             this.messageServiceExchange = A.Fake<IMessageServiceExchange>();

             A.CallTo(() => this.messageHandlerTypesIndexFactory.Create(A<Type[]>._)).Returns(this.messageHandlerTypesIndex);
             A.CallTo(() => this.messageHandlerInvokerFactory.CreateAggregate(A<IMessageHandlerTypesIndex>._)).Returns(this.messageHandlerInvoker);

             var messageType = typeof(TestMessageA);
             A.CallTo(() => this.messageHandlerTypesIndex.GetAllMessageTypes()).Returns(new[] { messageType });

             this.componentUnderTest = new InMemoryMessageListener(typeof(object), this.messageHandlerTypesIndexFactory, this.messageHandlerInvokerFactory, this.configuration, this.messageServiceExchange);
        }