コード例 #1
0
        public void GetQueueACL_HasAccessPolicies_ReturnsListConstainingThosePolicies()
        {
            IQueueServiceClient client = new QueueServiceClient(_accountSettings);
            var queueName = GenerateSampleQueueName();
            _util.CreateQueue(queueName);
            string expectedId = "abc-123";
            DateTime expectedStart = _util.GetTruncatedUtcNow();
            _util.AddAccessPolicy(queueName, expectedId, expectedStart, expectedStart.AddDays(1));

            var result = client.GetQueueACL(queueName);

            Assert.IsNotEmpty(result.SignedIdentifiers);
            Assert.AreEqual("abc-123", result.SignedIdentifiers.First().Id);
            Assert.AreEqual(expectedStart, result.SignedIdentifiers.First().AccessPolicy.StartTime);
            Assert.AreEqual(expectedStart.AddDays(1), result.SignedIdentifiers.First().AccessPolicy.Expiry);
        }
コード例 #2
0
        public void GetQueueACL_NonexistentQueue_ThrowsQueueNotFoundException()
        {
            IQueueServiceClient client = new QueueServiceClient(_accountSettings);
            var queueName = GenerateSampleQueueName();

            var result = client.GetQueueACL(queueName);

            // expects exception
        }
コード例 #3
0
        public void GetQueueACL_NoAccessPolicies_ReturnsEmptyList()
        {
            IQueueServiceClient client = new QueueServiceClient(_accountSettings);
            var queueName = GenerateSampleQueueName();
            _util.CreateQueue(queueName);

            var result = client.GetQueueACL(queueName);

            Assert.IsEmpty(result.SignedIdentifiers);
        }