Пример #1
0
        public void SynchronousTestQueueMetadataDynamic()
        {
            IQueueingService provider  = CreateProvider();
            QueueName        queueName = CreateRandomQueueName();

            provider.CreateQueue(queueName);

            JObject metadata = new JObject(
                new JProperty("valueA", 3),
                new JProperty("valueB", "yes"));

            provider.SetQueueMetadata(queueName, metadata);
            JObject result = provider.GetQueueMetadata(queueName);

            Assert.AreEqual(3, result["valueA"]);
            Assert.AreEqual("yes", result["valueB"]);

            provider.DeleteQueue(queueName);
        }
Пример #2
0
        public void SynchronousTestQueueMetadataStatic()
        {
            IQueueingService provider  = CreateProvider();
            QueueName        queueName = CreateRandomQueueName();

            provider.CreateQueue(queueName);

            SampleMetadata metadata = new SampleMetadata(3, "yes");

            Assert.AreEqual(3, metadata.ValueA);
            Assert.AreEqual("yes", metadata.ValueB);

            provider.SetQueueMetadata(queueName, metadata);
            SampleMetadata result = provider.GetQueueMetadata <SampleMetadata>(queueName);

            Assert.AreEqual(metadata.ValueA, result.ValueA);
            Assert.AreEqual(metadata.ValueB, result.ValueB);

            provider.DeleteQueue(queueName);
        }