public void DeleteAllQueues_AllQueuesAreDeleted() { CreateRandomNumberOfQueues(); Assert.IsTrue(QueueCleaner.GetAllQueues().Any()); QueueCleaner.DeleteAllQueues(); Assert.IsFalse(QueueCleaner.GetAllQueues().Any()); }
public void TestInitialize() { dataAccess = new Mock <IBusDataAccess>(); config = new QueueCleanerConfiguration("DefaultQueue", 10, true, true, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1)); cleaner = new QueueCleaner(config, dataAccess.Object); }
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 CleanUp() { QueueCleaner.DeleteAllQueues(); }
public void GetAllQueues_QueuesExist_ReturnsListOfQueues() { CreateRandomNumberOfQueues(); Assert.IsTrue(QueueCleaner.GetAllQueues().Any()); }
public void GetAllQueues_NoQueuesExist_ReturnsEmptyList() { Assert.IsTrue(!QueueCleaner.GetAllQueues().Any()); }