/// <summary>
        ///  Time range used as partition key value for all timeouts.
        /// </summary>
        /// <param name="partitionKeyScope">Partition key DateTime format string.</param>
        /// <param name="config"></param>
        /// <remarks>For optimal performance, this should be in line with the CatchUpInterval.</remarks>
        public static PersistenceExtentions <AzureStoragePersistence, StorageType.Timeouts> PartitionKeyScope(this PersistenceExtentions <AzureStoragePersistence, StorageType.Timeouts> config, string partitionKeyScope)
        {
            AzureTimeoutStorageGuard.CheckPartitionKeyScope(partitionKeyScope);

            config.GetSettings().Set("AzureTimeoutStorage.PartitionKeyScope", partitionKeyScope);
            return(config);
        }
        /// <summary>
        ///  Set the catchup interval in seconds for missed timeouts.
        /// </summary>
        /// <param name="catchUpInterval">Catch up interval in seconds</param>
        /// <param name="config"></param>
        public static PersistenceExtentions <AzureStoragePersistence, StorageType.Timeouts> CatchUpInterval(this PersistenceExtentions <AzureStoragePersistence, StorageType.Timeouts> config, int catchUpInterval)
        {
            AzureTimeoutStorageGuard.CheckCatchUpInterval(catchUpInterval);

            config.GetSettings().Set("AzureTimeoutStorage.CatchUpInterval", catchUpInterval);
            return(config);
        }
        /// <summary>
        ///  Set the name of the table where the timeouts themselves are stored.
        /// </summary>
        public static PersistenceExtentions <AzureStoragePersistence, StorageType.Timeouts> TimeoutDataTableName(this PersistenceExtentions <AzureStoragePersistence, StorageType.Timeouts> config, string tableName)
        {
            AzureTimeoutStorageGuard.CheckTableName(tableName);

            config.GetSettings().Set("AzureTimeoutStorage.TimeoutDataTableName", tableName);
            return(config);
        }
        /// <summary>
        /// Connection string to use for timeouts storage.
        /// </summary>
        public static PersistenceExtentions <AzureStoragePersistence, StorageType.Timeouts> ConnectionString(this PersistenceExtentions <AzureStoragePersistence, StorageType.Timeouts> config, string connectionString)
        {
            AzureTimeoutStorageGuard.CheckConnectionString(connectionString);

            config.GetSettings().Set("AzureTimeoutStorage.ConnectionString", connectionString);
            return(config);
        }
Esempio n. 5
0
 public void Should_not_allow_invalid_partition_key_scope(string partitionKeyScope)
 {
     Assert.Throws <ArgumentException>(() => AzureTimeoutStorageGuard.CheckPartitionKeyScope(partitionKeyScope));
 }
Esempio n. 6
0
 [TestCase("aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffgggg")] //
 // ReSharper restore StringLiteralTypo
 public void Should_not_allow_invalid_table_name(string tableName)
 {
     Assert.Throws <ArgumentException>(() => AzureTimeoutStorageGuard.CheckTableName(tableName));
 }
Esempio n. 7
0
 public void Should_not_allow_catch_up_interval_less_than_1_second()
 {
     Assert.Throws <ArgumentOutOfRangeException>(() => AzureTimeoutStorageGuard.CheckCatchUpInterval(0));
 }
Esempio n. 8
0
 public void Should_not_allow_invalid_connection_string(string connectionString)
 {
     Assert.Throws <ArgumentException>(() => AzureTimeoutStorageGuard.CheckConnectionString(connectionString));
 }