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

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

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

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

            _conn.UserCreds.AuthToken = "fail";
            Assert.Throws <CloudFilesException>(() => account.CreateContainer("foo"));
        }
コード例 #5
0
		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);
		}
コード例 #6
0
 /// <summary>
 /// Create a container
 /// </summary>
 /// <param name="containerName">Name of Container</param>
 public void CreateContainer(string containerName)
 {
     _account.CreateContainer(containerName);
 }
コード例 #7
0
        public void TestCreateContainerArgNull()
        {
            var account = new CF_Account(_conn, _client);

            Assert.Throws <ArgumentNullException>(() => account.CreateContainer(null));
        }
コード例 #8
0
ファイル: FileManager.cs プロジェクト: marinoscar/OpenSync
 private void CreateContainer()
 {
     var account = new CF_Account(_connection);
     _container = account.CreateContainer(_container.Name);
 }
コード例 #9
0
 public void TestCreateContainerFailUnauthorized()
 {
     var account = new CF_Account(_conn, _client);
     _conn.UserCreds.AuthToken = "fail-unauthorized";
     Assert.Throws<UnauthorizedException>(() => account.CreateContainer("foo"));
 }
コード例 #10
0
 public void TestCreateContainerFailTimeout()
 {
     var account = new CF_Account(_conn, _client);
     _conn.UserCreds.AuthToken = "fail-timeout";
     Assert.Throws<TimeoutException>(() => account.CreateContainer("foo"));
 }
コード例 #11
0
 public void TestCreateContainerFail()
 {
     var account = new CF_Account(_conn, _client);
     _conn.UserCreds.AuthToken = "fail";
     Assert.Throws<CloudFilesException>(() => account.CreateContainer("foo"));
 }
コード例 #12
0
 public void TestCreateContainerArgNull()
 {
     var account = new CF_Account(_conn, _client);
     Assert.Throws<ArgumentNullException>(() => account.CreateContainer(null));
 }
コード例 #13
0
 public void TestCreateContainer()
 {
     var account = new CF_Account(_conn, _client);
     _conn.UserCreds.AuthToken = "put-container";
     Assert.AreSame(account.CreateContainer("foo").GetType(), typeof(CF_Container));
 }