public async Task InitializeAsync() { FulcrumApplicationHelper.UnitTestSetup(nameof(AzureStorageV12QueueTest)); var connectionString = TestSettings.ConnectionString; Assert.IsNotNull(connectionString); _queue = new AzureStorageQueue <Message>(connectionString, "test-queue"); await _queue.ClearAsync(); }
public async Task InitializeNonExistingAsync() { var connectionString = TestSettings.ConnectionStringNonExisting; Assert.IsNotNull(connectionString); var queue = new AzureStorageQueue <Message>(connectionString, "test-queue", new QueueClientOptions { Retry = { MaxRetries = 0 } }); await queue.ClearAsync(); }
public async Task InitializeNonExistingAsync() { var connectionString = TestSettings.ConnectionStringNonExisting; Assert.IsNotNull(connectionString); var queue = new AzureStorageQueue <Message>(connectionString, "test-queue", new QueueRequestOptions() { MaximumExecutionTime = TimeSpan.FromMilliseconds(500) }); await queue.ClearAsync(); }
public async Task ClearQueueAsync() { var message = new Message { Name = "Message1" }; await _queue.AddMessageAsync(message); await _queue.ClearAsync(); var getTask = _queue.GetOneMessageNoBlockAsync(); await Task.Delay(TimeSpan.FromMilliseconds(200)); Assert.IsTrue(getTask.IsCompleted, "Expected the method to finish quickly."); Assert.IsNull(await getTask); }