public TestQueue(ILogger <MessagePublisher> publisherLogger, ILogger <MessageConsumer> consumerLogger)
 {
     _sqs             = TestConfig.Config.GetAWSOptions("AWS_SQS").CreateServiceClient <IAmazonSQS>();
     _sns             = TestConfig.Config.GetAWSOptions("AWS_SNS").CreateServiceClient <IAmazonSimpleNotificationService>();
     _messageOptions  = TestConfig.Config.Get <MessageServiceOptions>();
     MessagePublisher = new MessagePublisher(Options.Create(_messageOptions), publisherLogger, _sns);
     MessageConsumer  = new MessageConsumer(Options.Create(_messageOptions), consumerLogger, _sqs, new NLogContext(), new List <ITypedHandler>(), _messageHistory);
 }
Пример #2
0
 public MessageService(IOptions <MessageServiceOptions> config, IEventRestService eventRestService, INoteRestService noteRestService,
                       IAzureServiceBusClient azureBusManagerClient, IServiceBusClient serviceBus, ILogger <MessageService> logger)
 {
     _config                = config.Value;
     _logger                = logger;
     _eventRestService      = eventRestService;
     _noteRestService       = noteRestService;
     _azureBusManagerClient = azureBusManagerClient;
     _serviceBus            = serviceBus;
 }
        public MessageServiceFixture()
        {
            MessageServiceOptions buttonOptionsTTL = new MessageServiceOptions()
            {
                PushToQueueTimeToLive = 60
            };
            MessageServiceOptions buttonOptionsNoTTL = new MessageServiceOptions()
            {
                PushToQueueTimeToLive = 0
            };

            _mockMessageOptionsTTL   = new Mock <IOptions <MessageServiceOptions> >(MockBehavior.Strict);
            _mockMessageOptionsNoTTL = new Mock <IOptions <MessageServiceOptions> >(MockBehavior.Strict);
            _mockMessageOptionsTTL.Setup(ap => ap.Value).Returns(buttonOptionsTTL);
            _mockMessageOptionsNoTTL.Setup(ap => ap.Value).Returns(buttonOptionsNoTTL);
        }
 public MessageService(IOptions <MessageServiceOptions> toDoItemsServiceOptions, ILogger <MessageService> logger)
 {
     this.messageServiceOptions = toDoItemsServiceOptions.Value;
     this.logger = logger;
     this.cloudStorageAccount = this.CreateStorageAccount(this.messageServiceOptions.MessageServiceStorageConnectionString);
 }