public void GetAzureStorageConnectionString_ThrowsIfNotFound()
        {
            // Arrange
            var settings = new SettingsDictionary();

            // Act
            var ex = Assert.Throws <InvalidOperationException>(() => _manager.GetAzureStorageConnectionString(settings));

            // Assert
            Assert.Equal("Please provide a Microsoft Azure Storage connection string with name 'MS_AzureStoreConnectionString' in the configuration string section of the 'Web.Config' file.", ex.Message);
        }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AzureWebHookStore"/> class with the given <paramref name="manager"/>,
        /// <paramref name="settings"/>, and <paramref name="logger"/>.
        /// </summary>
        public AzureWebHookSender(IStorageManager manager, SettingsDictionary settings, ILogger logger)
        {
            if (manager == null)
            {
                throw new ArgumentNullException(nameof(manager));
            }
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }
            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }

            _manager = manager;
            _connectionString = manager.GetAzureStorageConnectionString(settings);
            _logger = logger;
        }
Example #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AzureWebHookStore"/> class with the given <paramref name="manager"/>,
        /// <paramref name="settings"/>, and <paramref name="logger"/>.
        /// Using this constructor, the data will not be encrypted while persisted to Azure Storage.
        /// </summary>
        public AzureWebHookStore(IStorageManager manager, SettingsDictionary settings, ILogger logger)
        {
            if (manager == null)
            {
                throw new ArgumentNullException(nameof(manager));
            }
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }
            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }

            _manager          = manager;
            _connectionString = manager.GetAzureStorageConnectionString(settings);
            _logger           = logger;
        }
Example #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AzureWebHookStore"/> class with the given <paramref name="manager"/>,
        /// <paramref name="settings"/>, <paramref name="protector"/>, and <paramref name="logger"/>.
        /// </summary>
        public AzureWebHookStore(IStorageManager manager, SettingsDictionary settings, IDataProtector protector, ILogger logger)
        {
            if (manager == null)
            {
                throw new ArgumentNullException("manager");
            }
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }
            if (protector == null)
            {
                throw new ArgumentNullException("protector");
            }
            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }

            _manager = manager;
            _connectionString = manager.GetAzureStorageConnectionString(settings);
            _protector = protector;
            _logger = logger;
        }
Example #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AzureWebHookStore"/> class with the given <paramref name="manager"/>,
        /// <paramref name="settings"/>, <paramref name="protector"/>, and <paramref name="logger"/>.
        /// </summary>
        public AzureWebHookStore(IStorageManager manager, SettingsDictionary settings, IDataProtector protector, ILogger logger)
        {
            if (manager == null)
            {
                throw new ArgumentNullException("manager");
            }
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }
            if (protector == null)
            {
                throw new ArgumentNullException("protector");
            }
            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }

            _manager          = manager;
            _connectionString = manager.GetAzureStorageConnectionString(settings);
            _protector        = protector;
            _logger           = logger;
        }