public void DeleteAllQueues_AllQueuesAreDeleted() { CreateRandomNumberOfQueues(); Assert.IsTrue(QueueCleaner.GetAllQueues().Any()); QueueCleaner.DeleteAllQueues(); Assert.IsFalse(QueueCleaner.GetAllQueues().Any()); }
private static void SendRandomMessageToAllQueues() { foreach (var queue in QueueCleaner.GetAllQueues()) { using (var transaction = new MessageQueueTransaction()) { transaction.Begin(); queue.Send(RandomUtil.GetRandomString(100), transaction); transaction.Commit(); } } }
public void PurgeAllQueues_QueuesArePurged() { CreateRandomNumberOfQueues(); Assert.IsTrue(QueueCleaner.GetAllQueues().Any()); SendRandomMessageToAllQueues(); QueueCleaner.PurgeAllQueues(); var queues = QueueCleaner.GetAllQueues(); foreach (var queue in queues) { Assert.IsTrue(!queue.GetAllMessages().Any()); } }
public void GetAllQueues_QueuesExist_ReturnsListOfQueues() { CreateRandomNumberOfQueues(); Assert.IsTrue(QueueCleaner.GetAllQueues().Any()); }
public void GetAllQueues_NoQueuesExist_ReturnsEmptyList() { Assert.IsTrue(!QueueCleaner.GetAllQueues().Any()); }