Provides a base implementation of IWebHookSender that defines the default format for HTTP requests sent as WebHooks.
Inheritance: IWebHookSender, IDisposable
        /// <summary>
        /// Intended for unit test purposes
        /// </summary>
        internal AzureWebHookDequeueManager(string connectionString, ILogger logger, TimeSpan pollingFrequency, TimeSpan messageTimeout, int maxAttempts, HttpClient httpClient, IStorageManager storageManager, WebHookSender sender)
        {
            if (connectionString == null)
            {
                throw new ArgumentNullException("connectionString");
            }
            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }
            if (pollingFrequency <= TimeSpan.Zero)
            {
                throw new ArgumentOutOfRangeException("pollingFrequency");
            }
            if (messageTimeout <= TimeSpan.Zero)
            {
                throw new ArgumentOutOfRangeException("messageTimeout");
            }

            _logger = logger;
            _pollingFrequency = pollingFrequency;
            _messageTimeout = messageTimeout;
            _maxAttempts = maxAttempts;

            _httpClient = httpClient ?? new HttpClient();
            _storageManager = storageManager ?? new StorageManager(logger);
            _sender = sender ?? new QueuedSender(this, logger);

            _queue = _storageManager.GetCloudQueue(connectionString, AzureWebHookSender.WebHookQueue);
        }
        /// <summary>
        /// Intended for unit test purposes
        /// </summary>
        internal AzureWebHookDequeueManager(string connectionString, ILogger logger, TimeSpan pollingFrequency, TimeSpan messageTimeout, int maxAttempts, HttpClient httpClient, IStorageManager storageManager, WebHookSender sender)
        {
            if (connectionString == null)
            {
                throw new ArgumentNullException(nameof(connectionString));
            }
            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }
            if (pollingFrequency <= TimeSpan.Zero)
            {
                throw new ArgumentOutOfRangeException(nameof(pollingFrequency));
            }
            if (messageTimeout <= TimeSpan.Zero)
            {
                throw new ArgumentOutOfRangeException(nameof(messageTimeout));
            }

            _logger           = logger;
            _pollingFrequency = pollingFrequency;
            _messageTimeout   = messageTimeout;
            _maxAttempts      = maxAttempts;

            _httpClient     = httpClient ?? new HttpClient();
            _storageManager = storageManager ?? new StorageManager(logger);
            _sender         = sender ?? new QueuedSender(this, logger);

            _queue = _storageManager.GetCloudQueue(connectionString, AzureWebHookSender.WebHookQueue);
        }
 public AzureWebHookDequeueManagerMock(AzureWebHookDequeueManagerTests parent, int maxAttempts = MaxAttempts, HttpClient httpClient = null, IStorageManager storageManager = null, WebHookSender sender = null)
     : base(ConnectionString, parent._logger, parent._pollingFrequency, parent._messageTimeout, maxAttempts, httpClient, storageManager, sender)
 {
 }
 public AzureWebHookDequeueManagerMock(AzureWebHookDequeueManagerTests parent, int maxAttempts = MaxAttempts, HttpClient httpClient = null, IStorageManager storageManager = null, WebHookSender sender = null)
     : base(ConnectionString, parent._logger, parent._pollingFrequency, parent._messageTimeout, maxAttempts, httpClient, storageManager, sender)
 {
 }