예제 #1
0
        public void Queue_should_be_deleted()
        {
            using (Model)
            {
                var queue = Model.QueueDeclare();
                Assert.IsNotNull(BrokerHttp.GetQueue(queue));

                Model.QueueDelete(queue);

                Assert.Throws <WebException>(() => BrokerHttp.GetQueue(queue));
            }
        }
예제 #2
0
        public void Should_respect_queue_lease()
        {
            var factory = new DefaultQueueFactory(false, false, false, TimeSpan.FromSeconds(2), null, _ => "");

            using (var connection = Helpers.CreateSafeShutdownConnection())
                using (var model = connection.CreateModel())
                {
                    var queue = factory.Create(model);

                    Assert.AreEqual(queue, BrokerHttp.GetQueue(queue).name);

                    Thread.Sleep(3000);

                    Assert.Throws <WebException>(() => BrokerHttp.GetQueue(queue));
                }
        }