public void SetupBeforeEachTest()
        {
            this.messageHandlerInvokerFactory = A.Fake<IMessageHandlerInvokerFactory>();
             this.messageHandlerTypesIndex = A.Fake<IMessageHandlerTypesIndex>();

             this.componentUnderTest = new AggregateMessageHandlerInvoker(this.messageHandlerTypesIndex, this.messageHandlerInvokerFactory);
        }
 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 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);
        }
예제 #6
0
        public void SetupBeforeEachTest()
        {
            this.channelManagerFactory = A.Fake<IChannelManagerFactory>();
             this.messageHandlerTypesIndexFactory = A.Fake<IMessageHandlerTypesIndexFactory>();
             this.messageHandlerInvokerFactory = A.Fake<IMessageHandlerInvokerFactory>();
             this.queueNameConvention = A.Fake<IQueueNameConvention>();
             this.messageEncoder = A.Fake<IMessageEncoder>();
             this.messageSerialiser = A.Fake<IMessageSerialiser>();
             this.logger = A.Fake<ILogger>();
             this.configuration = A.Fake<IConfiguration>();
             this.channelManager = A.Fake<IChannelManager>();
             this.channel = A.Fake<IModel>();

             A.CallTo(() => this.channelManagerFactory.Create()).Returns(this.channelManager);
             A.CallTo(() => this.channelManager.CreateChannel()).Returns(this.channel);

             this.componentUnderTest = new RabbitMQMessageListener(this.channelManagerFactory, new Type[0], this.messageHandlerTypesIndexFactory, this.messageHandlerInvokerFactory, this.queueNameConvention, this.messageEncoder, this.messageSerialiser, this.logger, this.configuration);
        }
 public RabbitMQMessageSubscriptionFactory(
  IMessageHandlerTypesIndexFactory messageHandlerTypesIndexFactory,
  IMessageHandlerInvokerFactory messageHandlerInvokerFactory,
  ITaskLibrary taskLibrary,
  IQueueNameConvention queueNameConvention,
  IMessageEncoder messageEncoder,
  IMessageSerialiser messageSerialiser,
  ILogger logger,
  IConfiguration configuration)
 {
     this.messageHandlerTypesIndexFactory = messageHandlerTypesIndexFactory;
      this.messageHandlerInvokerFactory = messageHandlerInvokerFactory;
      this.taskLibrary = taskLibrary;
      this.queueNameConvention = queueNameConvention;
      this.messageEncoder = messageEncoder;
      this.messageSerialiser = messageSerialiser;
      this.logger = logger;
      this.configuration = configuration;
 }
 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);
 }