Beispiel #1
0
        public void test_post_container()
        {
            _headers.Add("request-type", "container");
            ContainerResponse res = _client.PostContainer("", "", "", _headers, new Dictionary <string, string>());

            Assert.True(res.Reason == "foo");
            Assert.True(res.Status == 201);
        }
        public void test_post_container()
        {
            var headers = new Dictionary <string, string> {
                { container_metadata_prefix + metadata_key, metadata_value }
            };
            var container_name = prefix + Guid.NewGuid().ToString();

            created_containers.Add(container_name);
            client.PutContainer(storage_url, auth_token, container_name, new Dictionary <string, string>(), new Dictionary <string, string>());
            client.PostContainer(storage_url, auth_token, container_name, headers, new Dictionary <string, string>());
            var res = client.HeadContainer(storage_url, auth_token, container_name, new Dictionary <string, string>(), new Dictionary <string, string>());

            Assert.IsTrue(res.Headers.ContainsKey(container_metadata_prefix + metadata_key));
            Assert.IsTrue(res.Headers[container_metadata_prefix + metadata_key] == metadata_value);
            foreach (var header in container_headers)
            {
                Assert.IsTrue(res.Headers.ContainsKey(header));
            }
            headers[container_metadata_prefix + metadata_key] = "";
            client.PostContainer(storage_url, auth_token, container_name, headers, new Dictionary <string, string>());
            res = client.HeadContainer(storage_url, auth_token, container_name, new Dictionary <string, string>(), new Dictionary <string, string>());
            Assert.IsFalse(res.Headers.ContainsKey(container_metadata_prefix + metadata_key));
        }