Esempio n. 1
0
        public void Rename(ProjectFile logFile, string newName)
        {
            FileInfo fileInfo = new FileInfo(logFile.FilePath);
            string oldDirPath = fileInfo.Directory.FullName;
            string newDirPath = oldDirPath.Replace(logFile.Name.Replace(DefaultData.LogExtension, ""), newName);
            string newPath = Path.Combine(newDirPath, newName + DefaultData.LogExtension);

            //if (!Directory.Exists(newDirPath))
            //    Directory.CreateDirectory(newDirPath);

            File.Move(logFile.FilePath, Path.Combine(oldDirPath, newName + DefaultData.LogExtension));

            try
            {
                Directory.Move(oldDirPath, newDirPath);
            }
            catch (Exception e)
            {

            }

            //Directory.Delete(oldDirPath);

            logFile.FilePath = newPath;
            logFile.Name = newName + DefaultData.LogExtension;

            Log log = Open(newPath);
            log.Owner = logFile.Project;
            log.Name = newName;

            Save(log);
        }
Esempio n. 2
0
        public TestNode(ProjectFile projectFile, ITestController testController,
            ITestFileManager testFileManager)
        {
            this.projectFile = projectFile;
            this.testController = testController;
            this.testFileManager = testFileManager;

            DefaultCommand = new DelegateCommand(ExecuteDefaultCommand);
        }
Esempio n. 3
0
        public LogNode(ProjectFile logFile, ILogFileManager logFileManager,
            ILogController logController)
        {
            this.logFile = logFile;
            this.logFileManager = logFileManager;
            this.logController = logController;

            DefaultCommand = new DelegateCommand(ExecuteDefaultCommand);
        }
Esempio n. 4
0
 public IDisplayNode Create(ProjectFile projectFile)
 {
     return createNodeFunc(projectFile);
 }
Esempio n. 5
0
        public void Rename(ProjectFile projectFile, string newName)
        {
            string newPath = projectFile.FilePath.Replace(projectFile.Name, newName + DefaultData.TestExtension);
            string testScreenshotsFolder = ProjectSuiteManager.GetTestScreenshotsFolder(projectFile.Project);

            string oldName = projectFile.Name.Replace(DefaultData.TestExtension, "");

            File.Move(projectFile.FilePath, newPath);

            Directory.Move(Path.Combine(testScreenshotsFolder, oldName), Path.Combine(testScreenshotsFolder, newName));

            projectFile.FilePath = newPath;
            projectFile.Name = newName + DefaultData.TestExtension;

            Test test = Open(newPath);
            test.Project = projectFile.Project;
            test.Name = newName;

            Save(test);
        }