コード例 #1
0
ファイル: Queues_test.cs プロジェクト: simoneb/Roger
        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));
                }
        }