示例#1
0
        public void GetChildItem_TargetsFromValidInputXml_ShouldInitializeAllTwoTargets()
        {
            string inputValue = File.ReadAllText("TestData/TestProject.xml");

            IMsBuildProject project = MsBuildProjectFile.LoadContent(inputValue);

            Assert.AreEqual(2, project.GetChildren <IMsBuildTarget>().Count);
        }
示例#2
0
        public void Load_FromValidInputXml_ShouldInitializeInitializeTargets()
        {
            string inputValue = File.ReadAllText("TestData/TestProject.xml");

            IMsBuildProject project = MsBuildProjectFile.LoadContent(inputValue);

            Assert.AreEqual("TestTargetB", project.InitialTargets[0]);
        }
示例#3
0
        public void Load_FromValidInputXml_ShouldInitializeMsBuildToolsVersion()
        {
            string inputValue = File.ReadAllText("TestData/TestProject.xml");

            IMsBuildProject project = MsBuildProjectFile.LoadContent(inputValue);

            Assert.AreEqual("15.0", project.MsBuildVersion);
        }
示例#4
0
        public void GetChildItem_PropertyGroupFromValidInputXmlAndNotExistentChild_ShouldReturnEmptyList()
        {
            string inputValue = File.ReadAllText("TestData/TestProject.xml");

            IMsBuildProject project = MsBuildProjectFile.LoadContent(inputValue);

            Assert.AreEqual(0, project.GetChildren <IMsBuildPropertyGroup>()
                            .SelectMany(x => x.GetChildren <IMsBuildOnError>()).Count());
        }
示例#5
0
        public void GetChildItem_PropertyFromValidInputXml_ShouldInitializeAllThreeProperties()
        {
            string inputValue = File.ReadAllText("TestData/TestProject.xml");

            IMsBuildProject project = MsBuildProjectFile.LoadContent(inputValue);

            Assert.AreEqual(3, project.GetChildren <IMsBuildProperty>()
                            .Count());
        }
示例#6
0
        /// <summary>
        /// Creates the documentation by appending all required sections and prints the file to
        /// the given output directory.
        /// </summary>
        /// <param name="outputPath">Directory in which the documentation should be crated</param>
        public void CreateDocumentation(string outputPath)
        {
            PrepareOutputDirectory(outputPath);

            IFile           file           = FileSystem.Accessor.GetFile(_filePath);
            IMsBuildProject msBuildProject = MsBuildProjectFile.LoadContent(file.ReadAllText());

            CreateProjectOverview(msBuildProject, file, outputPath);
            CreateTargetDocumentation(outputPath, msBuildProject.GetChildren <IMsBuildTarget>());
        }
示例#7
0
 /// <summary>
 /// Loads the content as MSBuild project from the given file
 /// </summary>
 /// <param name="file">File from which the content should be loaded</param>
 /// <returns>MSBuild project representation</returns>
 private IMsBuildProject LoadMsBuildProject(IFile file)
 {
     return(MsBuildProjectFile.LoadContent(file.ReadAllText()));
 }