public TestDirectory(ICloudGateway gateway, RootName root, string apiKey, string path)
            {
                this.gateway = gateway;
                this.root    = root;

                var rootDirectory = gateway.GetRoot(root, apiKey);

                directory = gateway.NewDirectoryItem(root, rootDirectory.Id, path);
            }
            private TestDirectoryFixture(ICloudGateway gateway, RootName root, string apiKey, IDictionary <string, string> parameters, string path)
            {
                this.gateway = gateway;
                this.root    = root;

                gateway.GetDrive(root, apiKey, parameters);
                var rootDirectory = gateway.GetRoot(root, apiKey, parameters);

                var residualDirectory = gateway.GetChildItem(root, rootDirectory.Id).SingleOrDefault(f => f.Name == path) as DirectoryInfoContract;

                if (residualDirectory != null)
                {
                    gateway.RemoveItem(root, residualDirectory.Id, true);
                }

                directory = gateway.NewDirectoryItem(root, rootDirectory.Id, path);
            }
Beispiel #3
0
 public DirectoryInfoContract NewDirectoryItem(DirectoryInfoContract parent, string name)
 {
     return(ExecuteInSemaphore(() => {
         return _gateway.NewDirectoryItem(_rootName, parent.Id, name);
     }, nameof(NewDirectoryItem), true));
 }
 public DirectoryInfoContract NewDirectoryItem(DirectoryInfoContract parent, string name)
 {
     return(gateway.NewDirectoryItem(rootName, parent.Id, name));
 }