public void TestGetContainersFailUnauthorized()
        {
            var account = new CF_Account(_conn, _client);

            _conn.UserCreds.AuthToken = "fail-unauthorized";
            Assert.Throws <UnauthorizedException>(() => account.GetContainers());
        }
        public void TestGetContainersFail()
        {
            var account = new CF_Account(_conn, _client);

            _conn.UserCreds.AuthToken = "fail";
            Assert.Throws <CloudFilesException>(() => account.GetContainers());
        }
        public void TestGetContainersFailTimeout()
        {
            var account = new CF_Account(_conn, _client);

            _conn.UserCreds.AuthToken = "fail-timeout";
            Assert.Throws <TimeoutException>(() => account.GetContainers());
        }
        public void TestGetContainers()
        {
            var account = new CF_Account(_conn, _client);

            _conn.UserCreds.AuthToken = "get-account";
            Assert.AreSame(account.GetContainers().GetType(), typeof(List <Container>));
        }
		private void CheckContainer()
		{
			var account = new CF_Account(_conn, _client);

			var list = account.GetContainers(new Dictionary<ContainerQuery, string> { { ContainerQuery.Prefix, ContainerName } });
			if (!list.Any(e => e.Name.Equals(ContainerName)))
			{
				if (!RackspaceIsCreateContainerIfNotFound)
				{
					throw new ApplicationException(String.Format("Container not found [{0}]", ContainerName));
				}
				account.CreateContainer(ContainerName);
			}
			_container = new CF_Container(_conn, _client, ContainerName);
		}
Example #6
0
        /// <summary>
        /// Gets a list of all containers
        /// </summary>
        /// <returns>A list of all containers as <see cref="string"/></returns>
        public List <string> GetAllContainersAsSimpleList()
        {
            var containers = _account.GetContainers(true);

            return(containers.Select(x => x.Name).ToList());
        }
        public void TestGetContainersArgNull()
        {
            var account = new CF_Account(_conn, _client);

            Assert.Throws <ArgumentNullException>(() => account.GetContainers(null));
        }
 public void TestGetContainersFailUnauthorized()
 {
     var account = new CF_Account(_conn, _client);
     _conn.UserCreds.AuthToken = "fail-unauthorized";
     Assert.Throws<UnauthorizedException>(() => account.GetContainers());
 }
 public void TestGetContainersFailTimeout()
 {
     var account = new CF_Account(_conn, _client);
     _conn.UserCreds.AuthToken = "fail-timeout";
     Assert.Throws<TimeoutException>(() => account.GetContainers());
 }
 public void TestGetContainersFail()
 {
     var account = new CF_Account(_conn, _client);
     _conn.UserCreds.AuthToken = "fail";
     Assert.Throws<CloudFilesException>(() => account.GetContainers());
 }
 public void TestGetContainersArgNull()
 {
     var account = new CF_Account(_conn, _client);
     Assert.Throws<ArgumentNullException>(() => account.GetContainers(null));
 }
 public void TestGetContainers()
 {
     var account = new CF_Account(_conn, _client);
     _conn.UserCreds.AuthToken = "get-account";
     Assert.AreSame(account.GetContainers().GetType(), typeof(List<Container>));
 }