public TestDirectory(IAsyncCloudGateway gateway, RootName root, string apiKey, string path) { this.gateway = gateway; this.root = root; var rootDirectory = gateway.GetRootAsync(root, apiKey).Result; directory = gateway.NewDirectoryItemAsync(root, rootDirectory.Id, path).Result; }
public RootDirectoryInfoContract GetRoot() { return(ExecuteInSemaphore(() => { GetDrive(); var root = gateway.GetRootAsync(rootName, apiKey, parameters).Result; root.Drive = drive; return root; }, nameof(GetRoot))); }
public RootDirectoryInfoContract GetRoot() { try { var root = gateway.GetRootAsync(rootName, apiKey).Result; root.Drive = GetDrive(); return(root); } catch (AggregateException ex) when(ex.InnerExceptions.Count == 1) { throw ex.InnerExceptions[0]; } }
private TestDirectoryFixture(IAsyncCloudGateway gateway, RootName root, string apiKey, IDictionary <string, string> parameters, string path) { this.gateway = gateway; this.root = root; var rootDirectory = gateway.GetRootAsync(root, apiKey, parameters).Result; var residualDirectory = gateway.GetChildItemAsync(root, rootDirectory.Id).Result.SingleOrDefault(f => f.Name == path) as DirectoryInfoContract; if (residualDirectory != null) { gateway.RemoveItemAsync(root, residualDirectory.Id, true).Wait(); } directory = gateway.NewDirectoryItemAsync(root, rootDirectory.Id, path).Result; }