public void ExportTestWorkspace(TestWorkspace testWorkspace, string targetDirectory) { string testWorkspacePath = GetWorkspacePath(testWorkspace.ToString()); string targetWorkspacePath = targetDirectory + "\\" + testWorkspace.ToString() + "\\"; Directory.CreateDirectory(targetWorkspacePath); UtilityClass.CopyDirectory(testWorkspacePath, targetWorkspacePath); }
public ErrorResult ImportTestWorkspace(string sourceDirectory) { ErrorResult errorResult = new ErrorResult(); string workspacesPath = GetWorkspacesPath(); int startIndexOfDirectoryName = sourceDirectory.LastIndexOf('\\'); string directoryName = sourceDirectory.Substring(startIndexOfDirectoryName + 1); if (Directory.Exists(workspacesPath + directoryName)) { errorResult.errorCode = ErrorCode.DupicateWorkspaceName; return(errorResult); } Directory.CreateDirectory(workspacesPath + directoryName); UtilityClass.CopyDirectory(sourceDirectory + "\\", workspacesPath + directoryName + "\\"); testWorkspaceAddRemoveListener.TestWorkspaceAdded(LoadTestWorkspace(directoryName)); errorResult.errorCode = ErrorCode.Success; return(errorResult); }