コード例 #1
0
        /// <inheritdoc />
        public TestProject NewProject(string projectName)
        {
            if (string.IsNullOrEmpty(projectName))
                throw new ArgumentException("projectName");

            var testProjectData = new TestProjectData();
            return LoadProject(System.IO.Path.GetDirectoryName(projectName), testProjectData);
        }
コード例 #2
0
        private static TestProject LoadProject(string directoryName, TestProjectData testProjectData)
        {
            testProjectData.Validate(); // sanity check
            testProjectData.MakeAbsolutePaths(directoryName);

            var testProject = testProjectData.ToTestProject();
            return testProject;
        }
コード例 #3
0
        /// <inheritdoc />
        public void SaveProject(TestProject testProject, FileInfo testProjectFile)
        {
            if (testProject == null)
                throw new ArgumentNullException("testProject");
            if (testProjectFile == null)
                throw new ArgumentNullException("testProjectFile");

            var testProjectData = new TestProjectData(testProject);
            testProjectData.Validate(); // sanity check
            testProjectData.MakeRelativePaths(testProjectFile.DirectoryName);
            xmlSerializer.SaveToXml(testProjectData, testProjectFile.FullName);
        }