public void SetupBeforeEachTest() { this.messageHandlerInvokerFactory = A.Fake<IMessageHandlerInvokerFactory>(); this.messageHandlerTypesIndex = A.Fake<IMessageHandlerTypesIndex>(); this.componentUnderTest = new AggregateMessageHandlerInvoker(this.messageHandlerTypesIndex, this.messageHandlerInvokerFactory); }
public void SetupBeforeEachTest() { this.serviceBusResolver = A.Fake<IServiceBusResolver>(); this.messageHandlerExceptionHandler = A.Fake<IMessageHandlerExceptionHandler>(); this.messageHandlerTypesIndex = A.Fake<IMessageHandlerTypesIndex>(); this.componentUnderTest = new MessageHandlerInvokerFactory(this.serviceBusResolver, this.messageHandlerExceptionHandler, A.Fake<ILogger>()); }
public AggregateMessageHandlerInvoker( IMessageHandlerTypesIndex messageHandlerTypesIndex, IMessageHandlerInvokerFactory messageHandlerInvokerFactory) { this.messageHandlerTypesIndex = messageHandlerTypesIndex; this.messageHandlerInvokerFactory = messageHandlerInvokerFactory; this.invokers = new Dictionary<Type, IMessageHandlerInvoker>(); }
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 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); }
public RabbitMQMessageListener( IChannelManagerFactory channelManagerFactory, Type[] messageHandlerTypes, IMessageHandlerTypesIndexFactory messageHandlerTypesIndexFactory, IMessageHandlerInvokerFactory messageHandlerInvokerFactory, IQueueNameConvention queueNameConvention, IMessageEncoder messageEncoder, IMessageSerialiser messageSerialiser, ILogger logger, IConfiguration configuration) { this.channelManager = channelManagerFactory.Create(); this.queueNameConvention = queueNameConvention; this.messageEncoder = messageEncoder; this.messageSerialiser = messageSerialiser; this.logger = logger; this.configuration = configuration; this.messageHandlerTypesIndex = messageHandlerTypesIndexFactory.Create(messageHandlerTypes); this.messageHandlerInvoker = messageHandlerInvokerFactory.CreateAggregate(this.messageHandlerTypesIndex); }
public void SetupBeforeEachTest() { this.channelManagerFactory = A.Fake<IChannelManagerFactory>(); this.channelManager = A.Fake<IChannelManager>(); this.queueNameConvention = A.Fake<IQueueNameConvention>(); this.messageHandlerTypesIndexFactory = A.Fake<IMessageHandlerTypesIndexFactory>(); this.messageHandlerInvokerFactory = A.Fake<IMessageHandlerInvokerFactory>(); this.messageEncoder = A.Fake<IMessageEncoder>(); this.messageSerialiser = A.Fake<IMessageSerialiser>(); this.logger = A.Fake<ILogger>(); this.configuration = A.Fake<IConfiguration>(); this.model = A.Fake<IModel>(); this.messageHandlerTypesIndex = A.Fake<IMessageHandlerTypesIndex>(); this.messageHandlerInvoker = A.Fake<IMessageHandlerInvoker>(); this.messageHandlerTypes = new Type[0]; A.CallTo(() => this.channelManagerFactory.Create()).Returns(this.channelManager); A.CallTo(() => this.channelManager.CreateChannel()).Returns(this.model); A.CallTo(() => this.messageHandlerTypesIndexFactory.Create(A<Type[]>._)).Returns(this.messageHandlerTypesIndex); A.CallTo(() => this.messageHandlerInvokerFactory.CreateAggregate(A<IMessageHandlerTypesIndex>._)).Returns(this.messageHandlerInvoker); A.CallTo(() => this.configuration.ListenTimeout).Returns(20); this.componentUnderTest = new RabbitMQMessageListener(this.channelManagerFactory, this.messageHandlerTypes, this.messageHandlerTypesIndexFactory, this.messageHandlerInvokerFactory, this.queueNameConvention, this.messageEncoder, this.messageSerialiser, this.logger, this.configuration); }
public IMessageHandlerInvoker CreateAggregate(IMessageHandlerTypesIndex messageHandlerTypesIndex) { return new AggregateMessageHandlerInvoker(messageHandlerTypesIndex, this); }