public void GetChildItem_TargetsFromValidInputXml_ShouldInitializeAllTwoTargets() { string inputValue = File.ReadAllText("TestData/TestProject.xml"); IMsBuildProject project = MsBuildProjectFile.LoadContent(inputValue); Assert.AreEqual(2, project.GetChildren <IMsBuildTarget>().Count); }
public void Load_FromValidInputXml_ShouldInitializeInitializeTargets() { string inputValue = File.ReadAllText("TestData/TestProject.xml"); IMsBuildProject project = MsBuildProjectFile.LoadContent(inputValue); Assert.AreEqual("TestTargetB", project.InitialTargets[0]); }
public void Load_FromValidInputXml_ShouldInitializeMsBuildToolsVersion() { string inputValue = File.ReadAllText("TestData/TestProject.xml"); IMsBuildProject project = MsBuildProjectFile.LoadContent(inputValue); Assert.AreEqual("15.0", project.MsBuildVersion); }
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()); }
public void GetChildItem_PropertyFromValidInputXml_ShouldInitializeAllThreeProperties() { string inputValue = File.ReadAllText("TestData/TestProject.xml"); IMsBuildProject project = MsBuildProjectFile.LoadContent(inputValue); Assert.AreEqual(3, project.GetChildren <IMsBuildProperty>() .Count()); }
/// <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>()); }
/// <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())); }