public async Task DeleteQueueAsync() { var rsmq = new Rsmq(); await rsmq.CreateQueueAsync(new CreateQueueOptions { QueueName = Global.QueueName }); Assert.AreEqual(1, (await rsmq.ListQueuesAsync()).Count()); await rsmq.DeleteQueueAsync(new DeleteQueueOptions { QueueName = Global.QueueName }); Assert.Zero((await rsmq.ListQueuesAsync()).Count()); }
public async Task ListQueuesAsync() { var rsmq = new Rsmq(); var queues = await rsmq.ListQueuesAsync(); Assert.Zero(queues.Count()); await rsmq.CreateQueueAsync(new CreateQueueOptions { QueueName = Global.QueueName }); queues = await rsmq.ListQueuesAsync(); Assert.AreEqual(queues.Count(), 1); Assert.Contains(Global.QueueName, queues.ToArray()); }
public async Task CreateQueueAsync(string value) { var rsmq = new Rsmq(); Assert.AreEqual(1, await rsmq.CreateQueueAsync(new CreateQueueOptions { QueueName = value })); var queues = await rsmq.ListQueuesAsync(); Assert.Contains(value, queues.ToArray()); }
public async Task CreateQueueWithErrorAsync() { var rsmq = new Rsmq(); Assert.ThrowsAsync <MissingParameterException>(async() => await rsmq.CreateQueueAsync(new CreateQueueOptions { QueueName = null })); Assert.ThrowsAsync <InvalidFormatException>(async() => await rsmq.CreateQueueAsync(new CreateQueueOptions { QueueName = Global.WrongQueueNameFormat })); var queues = await rsmq.ListQueuesAsync(); Assert.Zero(queues.Count()); }