Example #1
0
 public void DeleteAllQueues_AllQueuesAreDeleted()
 {
     CreateRandomNumberOfQueues();
     Assert.IsTrue(QueueCleaner.GetAllQueues().Any());
     QueueCleaner.DeleteAllQueues();
     Assert.IsFalse(QueueCleaner.GetAllQueues().Any());
 }
Example #2
0
 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();
         }
     }
 }
Example #3
0
        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());
            }
        }
Example #4
0
 public void GetAllQueues_QueuesExist_ReturnsListOfQueues()
 {
     CreateRandomNumberOfQueues();
     Assert.IsTrue(QueueCleaner.GetAllQueues().Any());
 }
Example #5
0
 public void GetAllQueues_NoQueuesExist_ReturnsEmptyList()
 {
     Assert.IsTrue(!QueueCleaner.GetAllQueues().Any());
 }