Ejemplo n.º 1
0
        public void test_post_account()
        {
            _headers.Add("request-type", "account");
            AccountResponse res = _client.PostAccount("", "", _headers, new Dictionary <string, string>());

            Assert.True(res.Reason == "foo");
            Assert.True(res.Status == 201);
        }
Ejemplo n.º 2
0
        public void test_post_account()
        {
            var headers = new Dictionary <string, string> {
                { account_metadata_prefix + metadata_key, metadata_value }
            };

            client.PostAccount(storage_url, auth_token, headers, new Dictionary <string, string>());
            var res = client.HeadAccount(storage_url, auth_token, new Dictionary <string, string>(), new Dictionary <string, string>());

            Assert.IsTrue(res.Headers.ContainsKey(account_metadata_prefix + metadata_key));
            Assert.IsTrue(res.Headers[account_metadata_prefix + metadata_key] == metadata_value);
            client.PostAccount(storage_url, auth_token, headers, new Dictionary <string, string>());
            res = client.HeadAccount(storage_url, auth_token, new Dictionary <string, string>(), new Dictionary <string, string>());
            Assert.IsTrue(res.Headers.ContainsKey(account_metadata_prefix +
                                                  metadata_key));
            Assert.IsTrue(res.Headers[account_metadata_prefix + metadata_key] == metadata_value);
            headers[account_metadata_prefix + metadata_key] = "";
            client.PostAccount(storage_url, auth_token, headers, new Dictionary <string, string>());
            res = client.HeadAccount(storage_url, auth_token, new Dictionary <string, string>(), new Dictionary <string, string>());
            Assert.IsFalse(res.Headers.ContainsKey(account_metadata_prefix + metadata_key));
        }