Exemplo n.º 1
0
        public void TestGetCDNAccountFail()
        {
            Client client  = new CF_Client(new FakeHttpRequestFactory());
            var    headers = new Dictionary <string, string> {
                { "request-type", "cdn-account-fail" }
            };

            Assert.Throws <ClientException>(() => client.GetCDNAccount("foo", "foo", headers, new Dictionary <string, string>(), false));
        }
Exemplo n.º 2
0
        public void TestGetCDNAccount()
        {
            Client client  = new CF_Client(new FakeHttpRequestFactory());
            var    headers = new Dictionary <string, string> {
                { "request-type", "cdn-account" }
            };
            var res = client.GetCDNAccount("foo", "foo", headers, new Dictionary <string, string>(), false);

            Assert.AreEqual(res.Containers[0]["name"], "foo");
            Assert.AreEqual(res.Containers[0]["ttl"], "1");
            Assert.AreEqual(res.Containers[0]["cdn_url"], "http://foo.bar");
            Assert.AreEqual(res.Containers[0]["cdn_ssl_url"], "https://foo.bar");
            Assert.AreEqual(res.Containers[0]["cdn_streaming_url"], "http://foo.bar");
            Assert.AreEqual(res.Containers[0]["cdn_enabled"], "True");
            Assert.AreEqual(res.Containers[0]["log_retention"], "True");
            Assert.AreEqual(res.Status, 200);
        }
 public void TestGetCDNAccountFail()
 {
     Client client = new CF_Client(new FakeHttpRequestFactory());
     var headers  = new Dictionary<string, string> {{"request-type", "cdn-account-fail"}};
     Assert.Throws<ClientException>(() => client.GetCDNAccount("foo", "foo", headers, new Dictionary<string, string>(), false));
 }
 public void TestGetCDNAccount()
 {
     Client client = new CF_Client(new FakeHttpRequestFactory());
     var headers  = new Dictionary<string, string> {{"request-type", "cdn-account"}};
     var res = client.GetCDNAccount("foo", "foo", headers, new Dictionary<string, string>(), false);
     Assert.AreEqual(res.Containers[0]["name"], "foo");
     Assert.AreEqual(res.Containers[0]["ttl"], "1");
     Assert.AreEqual(res.Containers[0]["cdn_url"], "http://foo.bar");
     Assert.AreEqual(res.Containers[0]["cdn_ssl_url"], "https://foo.bar");
     Assert.AreEqual(res.Containers[0]["cdn_streaming_url"], "http://foo.bar");
     Assert.AreEqual(res.Containers[0]["cdn_enabled"], "True");
     Assert.AreEqual(res.Containers[0]["log_retention"], "True");
     Assert.AreEqual(res.Status, 200);
 }