コード例 #1
0
        public async Task GetQueueServicePropertiesAsync_HasCorsRule_ReturnsRule()
        {
            IQueueServiceClient client = new QueueServiceClient(_accountSettings);
            var sampleCors = _util.AddSampleToCors();

            var response = await client.GetQueueServicePropertiesAsync();

            //TODO come back and do better assertions
            Assert.AreEqual(1, response.Properties.Cors.Count);
            Assert.AreEqual(sampleCors.AllowedHeaders.Count, response.Properties.Cors[0].AllowedHeaders.Count);
            //Assert.AreEqual(sampleCors.AllowedMethods.Count, response.Properties.Cors[0].AllowedMethods.Count);
            Assert.AreEqual(sampleCors.AllowedOrigins.Count, response.Properties.Cors[0].AllowedOrigins.Count);
            Assert.AreEqual(sampleCors.ExposedHeaders.Count, response.Properties.Cors[0].ExposedHeaders.Count);
            Assert.AreEqual(sampleCors.MaxAgeInSeconds, response.Properties.Cors[0].MaxAgeInSeconds);
        }
コード例 #2
0
        public async Task GetQueueServicePropertiesAsync_HasNoCorsRule_ReturnsRule()
        {
            IQueueServiceClient client = new QueueServiceClient(_accountSettings);
            _util.ClearCorsRules();

            var response = await client.GetQueueServicePropertiesAsync();

            Assert.AreEqual(0, response.Properties.Cors.Count);
        }
コード例 #3
0
        public async Task GetQueueServicePropertiesAsync_EverythingEnabled_RetrievesPropertiesSuccessfully()
        {
            IQueueServiceClient client = new QueueServiceClient(_accountSettings);
            _util.SetServicePropertiesOn();

            var response = await client.GetQueueServicePropertiesAsync();

            Assert.IsTrue(response.Properties.Logging.Delete);
            Assert.IsTrue(response.Properties.Logging.Read);
            Assert.IsTrue(response.Properties.Logging.Write);
            Assert.IsTrue(response.Properties.Logging.RetentionPolicyEnabled);
            Assert.IsTrue(response.Properties.HourMetrics.Enabled);
            Assert.IsTrue(response.Properties.HourMetrics.IncludeAPIs);
            Assert.IsTrue(response.Properties.HourMetrics.RetentionPolicyEnabled);
            Assert.IsTrue(response.Properties.MinuteMetrics.Enabled);
            Assert.IsTrue(response.Properties.MinuteMetrics.IncludeAPIs);
            Assert.IsTrue(response.Properties.MinuteMetrics.RetentionPolicyEnabled);
        }