예제 #1
0
        public void ExportTestWorkspace(TestWorkspace testWorkspace, string targetDirectory)
        {
            string testWorkspacePath   = GetWorkspacePath(testWorkspace.ToString());
            string targetWorkspacePath = targetDirectory + "\\" + testWorkspace.ToString() + "\\";

            Directory.CreateDirectory(targetWorkspacePath);
            UtilityClass.CopyDirectory(testWorkspacePath, targetWorkspacePath);
        }
예제 #2
0
        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);
        }