コード例 #1
0
        public void TestGetContainer()
        {
            var account = new CF_Account(_conn, _client);

            _conn.UserCreds.AuthToken = "head-container";
            Assert.AreSame(account.GetContainer("foo").GetType(), typeof(CF_Container));
        }
コード例 #2
0
        public void TestGetContainerFailUnauthorized()
        {
            var account = new CF_Account(_conn, _client);

            _conn.UserCreds.AuthToken = "fail-unauthorized";
            Assert.Throws <UnauthorizedException>(() => account.GetContainer("foo"));
        }
コード例 #3
0
        public void TestGetContainerFailTimeout()
        {
            var account = new CF_Account(_conn, _client);

            _conn.UserCreds.AuthToken = "fail-timeout";
            Assert.Throws <TimeoutException>(() => account.GetContainer("foo"));
        }
コード例 #4
0
        public void TestGetContainerFailNotFound()
        {
            var account = new CF_Account(_conn, _client);

            _conn.UserCreds.AuthToken = "fail-not-found";
            Assert.Throws <ContainerNotFoundException>(() => account.GetContainer("foo"));
        }
コード例 #5
0
        public void TestGetContainerFail()
        {
            var account = new CF_Account(_conn, _client);

            _conn.UserCreds.AuthToken = "fail";
            var ex = Assert.Throws <CloudFilesException>(() => account.GetContainer("foo"));

            Assert.That(ex.Message, Is.EqualTo("Error: 500"));
        }
コード例 #6
0
        public void TestGetContainerArgNull()
        {
            var account = new CF_Account(_conn, _client);

            Assert.Throws <ArgumentNullException>(() => account.GetContainer(null));
        }
コード例 #7
0
 public void TestGetContainerFailUnauthorized()
 {
     var account = new CF_Account(_conn, _client);
     _conn.UserCreds.AuthToken = "fail-unauthorized";
     Assert.Throws<UnauthorizedException>(() => account.GetContainer("foo"));
 }
コード例 #8
0
 public void TestGetContainerFailTimeout()
 {
     var account = new CF_Account(_conn, _client);
     _conn.UserCreds.AuthToken = "fail-timeout";
     Assert.Throws<TimeoutException>(() => account.GetContainer("foo"));
 }
コード例 #9
0
 public void TestGetContainerFailNotFound()
 {
     var account = new CF_Account(_conn, _client);
     _conn.UserCreds.AuthToken = "fail-not-found";
     Assert.Throws<ContainerNotFoundException>(() => account.GetContainer("foo"));
 }
コード例 #10
0
 public void TestGetContainerFail()
 {
     var account = new CF_Account(_conn, _client);
     _conn.UserCreds.AuthToken = "fail";
     var ex = Assert.Throws<CloudFilesException>(() => account.GetContainer("foo"));
     Assert.That(ex.Message, Is.EqualTo("Error: 500"));
 }
コード例 #11
0
 public void TestGetContainerArgNull()
 {
     var account = new CF_Account(_conn, _client);
     Assert.Throws<ArgumentNullException>(() => account.GetContainer(null));
 }
コード例 #12
0
 public void TestGetContainer()
 {
     var account = new CF_Account(_conn, _client);
     _conn.UserCreds.AuthToken = "head-container";
     Assert.AreSame(account.GetContainer("foo").GetType(), typeof(CF_Container));
 }