Пример #1
0
 public void TestQueueService_DeclareQueue_InvalidExchange()
 {
     Assert.That(() =>
     {
         BaseQueueService.Declare("non.existing.exchange", "company.queues.finance2");
     }, Throws.TypeOf <ServiceException>());
 }
Пример #2
0
        public void TestQueueService_DeleteMany()
        {
            var qa = new QueueAddressModel()
            {
                Name = "company.queues.finance6", ExchangeName = "Test.Exchange"
            };
            var qa1 = new QueueAddressModel()
            {
                Name = "company.queues.finance7", ExchangeName = "Test.Exchange"
            };

            var q = new QueueDeleteModel()
            {
                Name = "company.queues.finance6"
            };
            var q1 = new QueueDeleteModel()
            {
                Name = "company.queues.finance7"
            };

            List <QueueDeleteModel> qs = new List <QueueDeleteModel>()
            {
                q, q1
            };
            List <QueueAddressModel> qas = new List <QueueAddressModel>()
            {
                qa, qa1
            };

            BaseQueueService.DeclareMany(qas);

            // Assert
            Assert.DoesNotThrow(() => { BaseQueueService.DeleteMany(qs); });
        }
Пример #3
0
        public void TestQueueService_DeleteObject()
        {
            var q = new QueueDeleteModel()
            {
                Name = "Test.ExchangeWithQueues.Queue1"
            };

            // Assert
            Assert.DoesNotThrow(() => { BaseQueueService.Delete(q); });
        }
Пример #4
0
        public void TestQueueService_UnbindQueue()
        {
            // Create exchanges
            TestQueueService_DeclareQueue_ValidExchange();

            // Data
            QueueBindingModel qu = new QueueBindingModel()
            {
                Source      = "amq.direct",
                Destination = "company.queues.finance2"
            };

            // Assert
            Assert.DoesNotThrow(() => { BaseQueueService.Unbind(qu); });
        }
Пример #5
0
 public void TestQueueService_DeclareQueue_ValidExchange()
 {
     Assert.DoesNotThrow(() => { BaseQueueService.Declare("amq.direct", "company.queues.finance2"); });
 }
Пример #6
0
 public void TestQueueService_DeleteString()
 {
     // Assert
     Assert.DoesNotThrow(() => { BaseQueueService.Delete("Test.ExchangeWithQueues.Queue2"); });
 }