1483 references to ObjectModelHelpers
Microsoft.Build.CommandLine.UnitTests (27)
XMake_Tests.cs (27)
1093string projectString = ObjectModelHelpers.CleanupFileContents( 1262string content = ObjectModelHelpers.CleanupFileContents("<Project ToolsVersion='msbuilddefaulttoolsversion' xmlns='msbuildnamespace'><Target Name='t'><Warning Text='[A=$(A)]'/></Target></Project>"); 1304string content = ObjectModelHelpers.CleanupFileContents("<Project ToolsVersion='msbuilddefaulttoolsversion' xmlns='msbuildnamespace'><Target Name='t'><Warning Text='[A=$(A)]'/></Target></Project>"); 1321string content = ObjectModelHelpers.CleanupFileContents("<Project ToolsVersion='msbuilddefaulttoolsversion' xmlns='msbuildnamespace'><Target Name='t'><Warning Text='[A=$(A)]'/></Target></Project>"); 1342string content = ObjectModelHelpers.CleanupFileContents("<Project ToolsVersion='msbuilddefaulttoolsversion' xmlns='msbuildnamespace'><Target Name='t'><Warning Text='[A=$(A)]'/></Target></Project>"); 1379string content = ObjectModelHelpers.CleanupFileContents("<Project ToolsVersion='msbuilddefaulttoolsversion' xmlns='msbuildnamespace'><Target Name='t'><Warning Text='[A=$(A)]'/></Target></Project>"); 1414string content = ObjectModelHelpers.CleanupFileContents("<Project ToolsVersion='msbuilddefaulttoolsversion' xmlns='msbuildnamespace'><Target Name='t'><Warning Text='[A=$(A)]'/></Target></Project>"); 1439string content = ObjectModelHelpers.CleanupFileContents("<Project ToolsVersion='msbuilddefaulttoolsversion' xmlns='msbuildnamespace'><Target Name='t'><Warning Text='[A=$(A)]'/></Target></Project>"); 1458string content = ObjectModelHelpers.CleanupFileContents("<Project ToolsVersion='msbuilddefaulttoolsversion' xmlns='msbuildnamespace'><Target Name='t'><Warning Text='[A=$(A)]'/></Target></Project>"); 1476var content = ObjectModelHelpers.CleanupFileContents("<Project><Target Name='t'><Message Text='Completed'/></Target></Project>"); 1494string content = ObjectModelHelpers.CleanupFileContents("<Project ToolsVersion='msbuilddefaulttoolsversion' xmlns='msbuildnamespace'><Target Name='t'><Warning Text='[A=$(A)]'/></Target></Project>"); 1513var content = ObjectModelHelpers.CleanupFileContents( 1553string contents = ObjectModelHelpers.CleanupFileContents(@" 1985string projectDirectory = Directory.CreateDirectory(Path.Combine(ObjectModelHelpers.TempProjectDir, Guid.NewGuid().ToString("N"))).FullName; 2008string projectDirectory = Directory.CreateDirectory(Path.Combine(ObjectModelHelpers.TempProjectDir, Guid.NewGuid().ToString("N"))).FullName; 2281string projectContents = ObjectModelHelpers.CleanupFileContents($@"<Project> 2316string projectContents = ObjectModelHelpers.CleanupFileContents($@"<Project> 2363string projectContents = ObjectModelHelpers.CleanupFileContents($@"<Project> 2409string projectContents = ObjectModelHelpers.CleanupFileContents( 2428string projectContents = ObjectModelHelpers.CleanupFileContents( 2453string projectContents = ObjectModelHelpers.CleanupFileContents($@"<Project> 2498string projectContents = ObjectModelHelpers.CleanupFileContents(@"<Project> 2517var testProject = _env.CreateFile("Importer.proj", ObjectModelHelpers.CleanupFileContents(@" 2557string projectContents = ObjectModelHelpers.CleanupFileContents(@$"<Project> 2597var testSolution = _env.CreateFile("TestSolution.sln", ObjectModelHelpers.CleanupFileContents(solutionFileContents)); 2648string projectContents = ObjectModelHelpers.CleanupFileContents(""" 2702string projectContents = ObjectModelHelpers.CleanupFileContents(@"<Project>
Microsoft.Build.Engine.OM.UnitTests (483)
Construction\ConstructionEditing_Tests.cs (62)
34string expected = ObjectModelHelpers.CleanupFileContents( 62string expected = ObjectModelHelpers.CleanupFileContents( 84string expected = ObjectModelHelpers.CleanupFileContents( 375string expected = ObjectModelHelpers.CleanupFileContents( 398string expected = ObjectModelHelpers.CleanupFileContents( 417string expected = ObjectModelHelpers.CleanupFileContents( 444string expected = ObjectModelHelpers.CleanupFileContents( 473string expected = ObjectModelHelpers.CleanupFileContents( 496string expected = ObjectModelHelpers.CleanupFileContents( 520string expected = ObjectModelHelpers.CleanupFileContents( 548string expected = ObjectModelHelpers.CleanupFileContents( 569string expected = ObjectModelHelpers.CleanupFileContents( 592string expected = ObjectModelHelpers.CleanupFileContents( 613string expected = ObjectModelHelpers.CleanupFileContents( 685string expected = ObjectModelHelpers.CleanupFileContents( 713string expected = ObjectModelHelpers.CleanupFileContents( 752string expected = ObjectModelHelpers.CleanupFileContents( 1095string expected = ObjectModelHelpers.CleanupFileContents( 1124string expected = ObjectModelHelpers.CleanupFileContents( 1179string expected = ObjectModelHelpers.CleanupFileContents(@"<Project ToolsVersion=""msbuilddefaulttoolsversion"" xmlns=""msbuildnamespace"" />"); 1314string expected = ObjectModelHelpers.CleanupFileContents( 1339string expected = ObjectModelHelpers.CleanupFileContents( 1363string expected = ObjectModelHelpers.CleanupFileContents( 1419string expected = ObjectModelHelpers.CleanupFileContents( 1445string expected = ObjectModelHelpers.CleanupFileContents( 1468string expected = ObjectModelHelpers.CleanupFileContents( 1489string expected = ObjectModelHelpers.CleanupFileContents( 1509string expected = ObjectModelHelpers.CleanupFileContents( 1531string expected = ObjectModelHelpers.CleanupFileContents( 1562string expected = ObjectModelHelpers.CleanupFileContents( 1585string expected = ObjectModelHelpers.CleanupFileContents( 1603string expected = ObjectModelHelpers.CleanupFileContents( 1623string expected = ObjectModelHelpers.CleanupFileContents( 1644string expected = ObjectModelHelpers.CleanupFileContents( 1666string expected = ObjectModelHelpers.CleanupFileContents( 1685string expected = ObjectModelHelpers.CleanupFileContents( 1706string expected = ObjectModelHelpers.CleanupFileContents( 1728string expected = ObjectModelHelpers.CleanupFileContents( 1752string expected = ObjectModelHelpers.CleanupFileContents( 1778string expected = ObjectModelHelpers.CleanupFileContents( 1804string expected = ObjectModelHelpers.CleanupFileContents( 1832string expected = ObjectModelHelpers.CleanupFileContents( 1855string expected = ObjectModelHelpers.CleanupFileContents( 1884string expected = ObjectModelHelpers.CleanupFileContents( 1912string expected = ObjectModelHelpers.CleanupFileContents( 1944string expected = ObjectModelHelpers.CleanupFileContents( 1980string expected = ObjectModelHelpers.CleanupFileContents( 2007string expected = ObjectModelHelpers.CleanupFileContents( 2029string expected = ObjectModelHelpers.CleanupFileContents( 2052string expected = ObjectModelHelpers.CleanupFileContents( 2075string expected = ObjectModelHelpers.CleanupFileContents( 2099string expected = ObjectModelHelpers.CleanupFileContents( 2122string expected = ObjectModelHelpers.CleanupFileContents( 2144string expected = ObjectModelHelpers.CleanupFileContents( 2167string expected = ObjectModelHelpers.CleanupFileContents( 2190string expected = ObjectModelHelpers.CleanupFileContents( 2214string expected = ObjectModelHelpers.CleanupFileContents( 2238string expected = ObjectModelHelpers.CleanupFileContents( 2316var projectFileContents = ObjectModelHelpers.CleanupFileContents( 2342var content = ObjectModelHelpers.CleanupFileContents( 3124string expected = ObjectModelHelpers.CleanupFileContents( 3199return ObjectModelHelpers.CleanupFileContents(string.Format(expected, expectedItem));
Construction\ElementLocationPublic_Tests.cs (1)
117var project = ObjectModelHelpers.CreateInMemoryProject(content);
Construction\ProjectFormatting_Tests.cs (28)
51string content = ObjectModelHelpers.CleanupFileContents(@" 60string reformattedContent = ObjectModelHelpers.CleanupFileContents(@" 78string content = ObjectModelHelpers.CleanupFileContents(@" 87string reformattedContent = ObjectModelHelpers.CleanupFileContents(@" 103string content = ObjectModelHelpers.CleanupFileContents(@" 122string expected = ObjectModelHelpers.CleanupFileContents(@"<?xml version=""1.0"" encoding=""utf-16""?> 139string content = ObjectModelHelpers.CleanupFileContents(@" 158string expected = ObjectModelHelpers.CleanupFileContents(@"<?xml version=""1.0"" encoding=""utf-16""?> 175string content = ObjectModelHelpers.CleanupFileContents(@" 193string expected = ObjectModelHelpers.CleanupFileContents(@"<?xml version=""1.0"" encoding=""utf-16""?> 209string content = ObjectModelHelpers.CleanupFileContents(@"<?xml version=""1.0"" encoding=""utf-8""?> 225string expected = ObjectModelHelpers.CleanupFileContents(@"<?xml version=""1.0"" encoding=""utf-8""?> 240string content = ObjectModelHelpers.CleanupFileContents(@" 254string expected = ObjectModelHelpers.CleanupFileContents(@"<?xml version=""1.0"" encoding=""utf-16""?> 269string content = ObjectModelHelpers.CleanupFileContents(@" 292string expected = ObjectModelHelpers.CleanupFileContents(@"<?xml version=""1.0"" encoding=""utf-16""?> 308string content = ObjectModelHelpers.CleanupFileContents(@" 331string expected = ObjectModelHelpers.CleanupFileContents(@"<?xml version=""1.0"" encoding=""utf-16""?> 350string content = ObjectModelHelpers.CleanupFileContents(@" 497string content = ObjectModelHelpers.CleanupFileContents(@" 512string content = ObjectModelHelpers.CleanupFileContents(@" 526string expected = ObjectModelHelpers.CleanupFileContents(@"<?xml version=""1.0"" encoding=""utf-8""?> 552string expected = ObjectModelHelpers.CleanupFileContents(@"<Project> 575string expected = ObjectModelHelpers.CleanupFileContents(@"<Project> 596string expected = ObjectModelHelpers.CleanupFileContents(@"<?xml version=`1.0` encoding=`utf-16`?> 619string expected = ObjectModelHelpers.CleanupFileContents(@"<?xml version=""1.0"" encoding=""utf-8""?> 643string expected = ObjectModelHelpers.CleanupFileContents(@"<Project> 685content = ObjectModelHelpers.CleanupFileContents(content);
Construction\ProjectMetadataElement_Tests.cs (16)
558ObjectModelHelpers.CleanupFileContents(projectContents), 586ObjectModelHelpers.CleanupFileContents(updatedProject); 602ObjectModelHelpers.CleanupFileContents(projectContents), 629ObjectModelHelpers.CleanupFileContents(@" 676ObjectModelHelpers.CleanupFileContents(projectContents), 703ObjectModelHelpers.CleanupFileContents(updatedProject); 719ObjectModelHelpers.CleanupFileContents(projectContents), 746ObjectModelHelpers.CleanupFileContents(@" 832ObjectModelHelpers.CleanupFileContents(updatedProject); 895ObjectModelHelpers.CleanupFileContents(updatedProject); 964ObjectModelHelpers.CleanupFileContents(updatedProject); 1007ObjectModelHelpers.CleanupFileContents(@" 1076ObjectModelHelpers.CleanupFileContents(updatedProject); 1116ObjectModelHelpers.CleanupFileContents(@" 1194ObjectModelHelpers.CleanupFileContents(updatedProject); 1241ObjectModelHelpers.CleanupFileContents(@"
Construction\ProjectPropertyGroupElement_Tests.cs (3)
35string content = ObjectModelHelpers.CleanupFileContents(@" 54string content = ObjectModelHelpers.CleanupFileContents(@" 118string expected = ObjectModelHelpers.CleanupFileContents(
Construction\ProjectRootElement_Tests.cs (29)
111Assert.Equal(ObjectModelHelpers.MSBuildDefaultToolsVersion, project.ToolsVersion); 528string toolsPath = projectCollection.Toolsets.Where(toolset => (string.Equals(toolset.ToolsVersion, ObjectModelHelpers.MSBuildDefaultToolsVersion, StringComparison.OrdinalIgnoreCase))).First().ToolsPath; 581string expected = ObjectModelHelpers.CleanupFileContents( 610string expected = ObjectModelHelpers.CleanupFileContents( 707using ProjectRootElementFromString projectRootElementFromStringUTF16 = new(ObjectModelHelpers.CleanupFileContents(@"<?xml version=""1.0"" encoding=""utf-16""?> 713using ProjectRootElementFromString projectRootElementFromStringUTF8 = new(ObjectModelHelpers.CleanupFileContents(@"<?xml version=""1.0"" encoding=""utf-8""?> 719using ProjectRootElementFromString projectRootElementFromStringASCII = new(ObjectModelHelpers.CleanupFileContents(@"<?xml version=""1.0"" encoding=""us-ascii""?> 758using ProjectRootElementFromString projectRootElementFromString = new(ObjectModelHelpers.CleanupFileContents(@" 788string content = ObjectModelHelpers.CleanupFileContents( 846string content = ObjectModelHelpers.CleanupFileContents( 1021string[] paths = ObjectModelHelpers.GetTempFiles(iterations); 1097string[] paths = ObjectModelHelpers.GetTempFiles(iterations); 1273using ProjectRootElementFromString projectRootElementFromString = new(ObjectModelHelpers.CleanupFileContents(project)); 1296ObjectModelHelpers.CleanupFileContents(project), 1334var projectElement = ObjectModelHelpers.CreateInMemoryProjectRootElement(SimpleProject, null, initialPreserveFormatting); 1345using var xmlReader = XmlReader.Create(new StringReader(ObjectModelHelpers.CleanupFileContents(SimpleProject))); 1538var initialProjectContents = ObjectModelHelpers.CleanupFileContents( 1553var changedProjectContents1 = ObjectModelHelpers.CleanupFileContents( 1570var changedProjectContents2 = ObjectModelHelpers.CleanupFileContents( 1599var projectElement = ObjectModelHelpers.CreateInMemoryProjectRootElement(initialProjectContents, projectCollection1, preserveFormatting: true); 1740rootElement = ObjectModelHelpers.CreateInMemoryProjectRootElement(SimpleProject, projectCollection); 1745File.WriteAllText(initialLocation, ObjectModelHelpers.CleanupFileContents(SimpleProject)); 1755using var xmlReader = XmlReader.Create(new StringReader(ObjectModelHelpers.CleanupFileContents(ComplexProject))); 1761File.WriteAllText(reloadLocation, ObjectModelHelpers.CleanupFileContents(ComplexProject)); 1846XmlReader.Create(new StringReader(ObjectModelHelpers.CleanupFileContents(c))), 1861var projectElement = ObjectModelHelpers.CreateInMemoryProjectRootElement(initialContents); 1868act(projectElement, ObjectModelHelpers.CleanupFileContents(changedContents)); 1968writer.Write(ObjectModelHelpers.CleanupFileContents(EmptyProject)); 1977string content = ObjectModelHelpers.CleanupFileContents(ComplexProject);
Construction\WhiteSpacePreservation_Tests.cs (2)
465var expected = ObjectModelHelpers.CleanupFileContents(updatedProject); 471File.WriteAllText(file, ObjectModelHelpers.CleanupFileContents(projectContents));
Definition\DefinitionEditing_Tests.cs (67)
154string expected = ObjectModelHelpers.CleanupFileContents( 181string expected = ObjectModelHelpers.CleanupFileContents( 211string expected = ObjectModelHelpers.CleanupFileContents( 248string expected = ObjectModelHelpers.CleanupFileContents( 351string expected = ObjectModelHelpers.CleanupFileContents( 375string expected = ObjectModelHelpers.CleanupFileContents( 400string expected = ObjectModelHelpers.CleanupFileContents( 426string expected = ObjectModelHelpers.CleanupFileContents( 452string expected = ObjectModelHelpers.CleanupFileContents( 476string expected = ObjectModelHelpers.CleanupFileContents( 501string expected = ObjectModelHelpers.CleanupFileContents( 533string expected = ObjectModelHelpers.CleanupFileContents( 563string expected = ObjectModelHelpers.CleanupFileContents( 592string expected = ObjectModelHelpers.CleanupFileContents( 620string expected = ObjectModelHelpers.CleanupFileContents( 647string expected = ObjectModelHelpers.CleanupFileContents( 680ObjectModelHelpers.CleanupFileContents( 710var content = ObjectModelHelpers.CleanupFileContents( 724string expected = ObjectModelHelpers.CleanupFileContents( 749var content = ObjectModelHelpers.CleanupFileContents( 765string expected = ObjectModelHelpers.CleanupFileContents( 801ObjectModelHelpers.CleanupFileContents( 836string expected = ObjectModelHelpers.CleanupFileContents( 864string expected = ObjectModelHelpers.CleanupFileContents( 989var content = ObjectModelHelpers.CleanupFileContents( 1005string expected = ObjectModelHelpers.CleanupFileContents( 1037string expected = ObjectModelHelpers.CleanupFileContents( 1066string expected = ObjectModelHelpers.CleanupFileContents( 1106ObjectModelHelpers.CleanupFileContents( 1179string expected = ObjectModelHelpers.CleanupFileContents( 1223string expected = ObjectModelHelpers.CleanupFileContents( 1247expected = ObjectModelHelpers.CleanupFileContents( 1272string expected = ObjectModelHelpers.CleanupFileContents( 1308string expected = ObjectModelHelpers.CleanupFileContents(@"<Project ToolsVersion=""msbuilddefaulttoolsversion"" xmlns=""msbuildnamespace"" />"); 1324var content = ObjectModelHelpers.CleanupFileContents( 1339string expected = ObjectModelHelpers.CleanupFileContents( 1367string expected = ObjectModelHelpers.CleanupFileContents( 1402ObjectModelHelpers.CleanupFileContents( 1427var content = ObjectModelHelpers.CleanupFileContents( 1477string expected = ObjectModelHelpers.CleanupFileContents( 1502string expected = ObjectModelHelpers.CleanupFileContents( 1826string expected = ObjectModelHelpers.CleanupFileContents(@"<Project ToolsVersion=""msbuilddefaulttoolsversion"" xmlns=""msbuildnamespace"" />"); 1849string expected = ObjectModelHelpers.CleanupFileContents( 1871string expected = ObjectModelHelpers.CleanupFileContents( 1899string expected = ObjectModelHelpers.CleanupFileContents( 1929string expected = ObjectModelHelpers.CleanupFileContents( 1976string expected = ObjectModelHelpers.CleanupFileContents( 1998var content = ObjectModelHelpers.CleanupFileContents( 2018string expected = ObjectModelHelpers.CleanupFileContents( 2053string expected = ObjectModelHelpers.CleanupFileContents( 2078string expected = ObjectModelHelpers.CleanupFileContents( 2105string expected = ObjectModelHelpers.CleanupFileContents( 2135string expected = ObjectModelHelpers.CleanupFileContents( 2172string expected = ObjectModelHelpers.CleanupFileContents( 2272string expected = ObjectModelHelpers.CleanupFileContents( 2296string expected = ObjectModelHelpers.CleanupFileContents( 2321string expected = ObjectModelHelpers.CleanupFileContents( 2347string expected = ObjectModelHelpers.CleanupFileContents( 2373string expected = ObjectModelHelpers.CleanupFileContents( 2397string expected = ObjectModelHelpers.CleanupFileContents( 2422string expected = ObjectModelHelpers.CleanupFileContents( 2450string expected = ObjectModelHelpers.CleanupFileContents( 2480string expected = ObjectModelHelpers.CleanupFileContents( 2509string expected = ObjectModelHelpers.CleanupFileContents( 2537string expected = ObjectModelHelpers.CleanupFileContents( 2564string expected = ObjectModelHelpers.CleanupFileContents( 2581projectContents = ObjectModelHelpers.CleanupFileContents(projectContents);
Definition\Project_Tests.cs (68)
92string projectFileContent = ObjectModelHelpers.CleanupFileContents(@" 127string projectFileContent = ObjectModelHelpers.CleanupFileContents(@" 155string projectFileContent = ObjectModelHelpers.CleanupFileContents(@" 227File.WriteAllText(file, ObjectModelHelpers.CleanupFileContents(@"<Project xmlns='msbuildnamespace'/>")); 305string emptyProject = ObjectModelHelpers.CleanupFileContents(@"<Project ToolsVersion=""msbuilddefaulttoolsversion"" xmlns=""msbuildnamespace""/>"); 558string importContent = ObjectModelHelpers.CleanupFileContents(@" 571string importPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("import.targets", importContent); 573string projectFileContent = ObjectModelHelpers.CleanupFileContents(@" 623ObjectModelHelpers.DeleteTempProjectDirectory(); 634string projectFileContent = ObjectModelHelpers.CleanupFileContents(@" 669string projectFileContent = ObjectModelHelpers.CleanupFileContents(@" 703string projectFileContent = ObjectModelHelpers.CleanupFileContents(@"<Project xmlns='msbuildnamespace'> 738string projectFileContent = ObjectModelHelpers.CleanupFileContents(@" 774string projectFileContent = ObjectModelHelpers.CleanupFileContents(@" 1072ObjectModelHelpers.MSBuildDefaultToolsVersion); 1074project.ToolsVersion.ShouldBe(ObjectModelHelpers.MSBuildDefaultToolsVersion); 1092ObjectModelHelpers.DeleteTempProjectDirectory(); 1103project.ToolsVersion.ShouldBe(ObjectModelHelpers.MSBuildDefaultToolsVersion); 1127project.ToolsVersion.ShouldBe(ObjectModelHelpers.MSBuildDefaultToolsVersion); 1132project.ToolsVersion.ShouldBe(ObjectModelHelpers.MSBuildDefaultToolsVersion); 1152project.ToolsVersion.ShouldBe(ObjectModelHelpers.MSBuildDefaultToolsVersion); 1154project.Xml.ToolsVersion = ObjectModelHelpers.MSBuildDefaultToolsVersion; 1156project.ToolsVersion.ShouldBe(ObjectModelHelpers.MSBuildDefaultToolsVersion); 1180project.GetPropertyValue("msbuildtoolsversion").ShouldBe(ObjectModelHelpers.MSBuildDefaultToolsVersion); 1185project.GetPropertyValue("msbuildtoolsversion").ShouldBe(ObjectModelHelpers.MSBuildDefaultToolsVersion); 1190project.GetPropertyValue("msbuildtoolsversion").ShouldBe(ObjectModelHelpers.MSBuildDefaultToolsVersion); 1202project.GetPropertyValue("msbuildtoolsversion").ShouldBe(ObjectModelHelpers.MSBuildDefaultToolsVersion); 1233Project p = new Project(GetSampleProjectRootElement(), null, ObjectModelHelpers.MSBuildDefaultToolsVersion, collection); 1235p.ToolsVersion.ShouldBe(ObjectModelHelpers.MSBuildDefaultToolsVersion); 1237Toolset t = p.ProjectCollection.GetToolset(ObjectModelHelpers.MSBuildDefaultToolsVersion); 1263Project p = new Project(GetSampleProjectRootElement(), null, ObjectModelHelpers.MSBuildDefaultToolsVersion, collection); 1265p.ToolsVersion.ShouldBe(ObjectModelHelpers.MSBuildDefaultToolsVersion); 1291Project p = new Project(GetSampleProjectRootElement(), globalProperties, ObjectModelHelpers.MSBuildDefaultToolsVersion, collection); 1293p.ToolsVersion.ShouldBe(ObjectModelHelpers.MSBuildDefaultToolsVersion); 1323Project p = new Project(GetSampleProjectRootElement(), globalProperties, ObjectModelHelpers.MSBuildDefaultToolsVersion, "ABCDEF", collection, ProjectLoadSettings.Default); 1325p.ToolsVersion.ShouldBe(ObjectModelHelpers.MSBuildDefaultToolsVersion); 1428var importProjectContents = ObjectModelHelpers.CleanupFileContents( 1470var importProjectContents = ObjectModelHelpers.CleanupFileContents( 1485var changedImportContents = ObjectModelHelpers.CleanupFileContents( 1556var projectContents = ObjectModelHelpers.CleanupFileContents( 1571var changedProjectContents = ObjectModelHelpers.CleanupFileContents( 1839string content = ObjectModelHelpers.CleanupFileContents(@" 1867string content = ObjectModelHelpers.CleanupFileContents(@" 1903string content = ObjectModelHelpers.CleanupFileContents(@" 1940string content = ObjectModelHelpers.CleanupFileContents(@" 1992string content = ObjectModelHelpers.CleanupFileContents(@" 2021string content = ObjectModelHelpers.CleanupFileContents(@" 2089ObjectModelHelpers.CleanupFileContents(@"<Project xmlns='msbuildnamespace'> 2096ObjectModelHelpers.CleanupFileContents(@"<Project xmlns='msbuildnamespace'> 2181string contents = ObjectModelHelpers.CleanupFileContents(@"<Project xmlns='msbuildnamespace'/>"); 2212string projectOriginalContents = ObjectModelHelpers.CleanupFileContents(@" 2235string projectOriginalContents = ObjectModelHelpers.CleanupFileContents(@" 2257string projectOriginalContents = ObjectModelHelpers.CleanupFileContents(@" 2279string projectOriginalContents = ObjectModelHelpers.CleanupFileContents(@" 2306string projectOriginalContents = ObjectModelHelpers.CleanupFileContents(@" 2323string projectExpectedContents = ObjectModelHelpers.CleanupFileContents(@" 2342string projectOriginalContents = ObjectModelHelpers.CleanupFileContents(@" 2395string projectOriginalContents = ObjectModelHelpers.CleanupFileContents(@" 2650string projectOriginalContents = ObjectModelHelpers.CleanupFileContents(@" 2695string projectOriginalContents = ObjectModelHelpers.CleanupFileContents(@" 2878var project = ObjectModelHelpers.CreateInMemoryProject(projectContents); 3737var getAllGlobsResult = ObjectModelHelpers.CreateInMemoryProject(projectContents).GetAllGlobs(); 4298var globs = ObjectModelHelpers.CreateInMemoryProject(project).GetAllGlobs(); 4304var globs = ObjectModelHelpers.CreateInMemoryProject(project).GetAllGlobs(itemType); 4323var provenanceResult = ObjectModelHelpers.CreateInMemoryProject(project).GetItemProvenance(itemValue); 4329var provenanceResult = ObjectModelHelpers.CreateInMemoryProject(project).GetItemProvenance(itemValue, itemType); 4345p = ObjectModelHelpers.CreateInMemoryProject(project); 4390string projectFileContent = ObjectModelHelpers.CleanupFileContents(@"
Definition\ProjectCollection_Tests.cs (18)
270Project project = collection.LoadProject(reader, ObjectModelHelpers.MSBuildDefaultToolsVersion); 413new Project(xml, globalProperties1, ObjectModelHelpers.MSBuildDefaultToolsVersion) 420new Project(xml, globalProperties2, ObjectModelHelpers.MSBuildDefaultToolsVersion) 425Assert.True(ReferenceEquals(project1, ProjectCollection.GlobalProjectCollection.LoadProject(projectDirectory, globalProperties1, ObjectModelHelpers.MSBuildDefaultToolsVersion))); 426Assert.True(ReferenceEquals(project2, ProjectCollection.GlobalProjectCollection.LoadProject(projectDirectory, globalProperties2, ObjectModelHelpers.MSBuildDefaultToolsVersion))); 512var project2 = new Project(xml, null, ObjectModelHelpers.MSBuildDefaultToolsVersion) { FullPath = "c:\\1" }; 514Assert.True(ReferenceEquals(project2, ProjectCollection.GlobalProjectCollection.LoadProject("c:\\1", null, ObjectModelHelpers.MSBuildDefaultToolsVersion))); 1092Assert.Equal(ObjectModelHelpers.MSBuildDefaultToolsVersion, collection.DefaultToolsVersion); 1112Assert.Equal(ObjectModelHelpers.MSBuildDefaultToolsVersion, collection.DefaultToolsVersion); 1152string content = ObjectModelHelpers.CleanupFileContents(@" 1165Assert.Equal(project.ToolsVersion, ObjectModelHelpers.MSBuildDefaultToolsVersion); 1268Project project = collection.LoadProject(reader, ObjectModelHelpers.MSBuildDefaultToolsVersion); 1277project = collection2.LoadProject(reader2, ObjectModelHelpers.MSBuildDefaultToolsVersion); 1286project = collection3.LoadProject(reader3, ObjectModelHelpers.MSBuildDefaultToolsVersion); 1295project = collection4.LoadProject(reader4, ObjectModelHelpers.MSBuildDefaultToolsVersion); 1304project = collection5.LoadProject(reader5, ObjectModelHelpers.MSBuildDefaultToolsVersion); 1314project = collection6.LoadProject(reader6, ObjectModelHelpers.MSBuildDefaultToolsVersion); 1322project = collection7.LoadProject(reader7, ObjectModelHelpers.MSBuildDefaultToolsVersion);
Definition\ProjectItem_Tests.cs (144)
416IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment("<i Include='i0;" + directory + (NativeMethodsShared.IsWindows ? @"\**\*;i2'/>" : "/**/*;i2'/>")); 438IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment(itemDefinition, allItems: false, ignoreCondition: true); 454IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment(itemDefinition.Replace("somedir", directory.Path), allItems: false, ignoreCondition: true); 465IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment("<i Include='a;b' Exclude='b;c'/>"); 491IList<ProjectItem> items = ObjectModelHelpers.GetItems(content); 495ObjectModelHelpers.AssertItems(new[] { "a", "b", "c", "x", "z", "a", "c", "u", "w" }, items); 519IList<ProjectItem> items = ObjectModelHelpers.GetItems(content); 523ObjectModelHelpers.AssertItems(new[] { "a", "b", "c", "z", "a", "c", "u" }, items); 936content = ObjectModelHelpers.CleanupFileContents(content); 999ObjectModelHelpers.AssertItemEvaluationFromProject(formattedProjectContents, inputFiles, expectedInclude, expectedMetadataPerItem: null, normalizeSlashes: normalizeSlashes, makeExpectedIncludeAbsolute: makeExpectedIncludeAbsolute); 1115ObjectModelHelpers.AssertItems(expectedInclude, new Project(projectFile).Items.ToList()); 1155ObjectModelHelpers.AssertItems(expectedInclude, new Project(testFiles.ProjectFile, new Dictionary<string, string>(), MSBuildConstants.CurrentToolsVersion, projectCollection).Items.ToList()); 1175ObjectModelHelpers.AssertItems(expectedInclude, new Project(testFiles.ProjectFile, new Dictionary<string, string>(), MSBuildConstants.CurrentToolsVersion, projectCollection).Items.ToList()); 1659IList<ProjectItem> items = ObjectModelHelpers.GetItems(content); 1686IList<ProjectItem> items = ObjectModelHelpers.GetItems(content); 1711IList<ProjectItem> items = ObjectModelHelpers.GetItems(content); 1736IList<ProjectItem> items = ObjectModelHelpers.GetItems(content); 1761IList<ProjectItem> items = ObjectModelHelpers.GetItems(content); 1786IList<ProjectItem> items = ObjectModelHelpers.GetItems(content); 1810IList<ProjectItem> items = ObjectModelHelpers.GetItems(content); 1834IList<ProjectItem> items = ObjectModelHelpers.GetItems(content); 1858IList<ProjectItem> items = ObjectModelHelpers.GetItems(content); 2157var project = ObjectModelHelpers.CreateInMemoryProject(env.CreateProjectCollection().Collection, projectContents); 2183var project = ObjectModelHelpers.CreateInMemoryProject(env.CreateProjectCollection().Collection, projectContents); 2315IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment( 2326IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment( 2338IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment( 2349IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment( 2370IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment(content); 2378var projectContents = ObjectModelHelpers.FormatProjectContentsWithItemGroupFragment( 2383var project = ObjectModelHelpers.CreateInMemoryProject(projectContents); 2394var projectContents = ObjectModelHelpers.FormatProjectContentsWithItemGroupFragment( 2400var project = ObjectModelHelpers.CreateInMemoryProject(projectContents); 2408string content = ObjectModelHelpers.FormatProjectContentsWithItemGroupFragment( 2421var project = ObjectModelHelpers.CreateInMemoryProject(content); 2435string content = ObjectModelHelpers.FormatProjectContentsWithItemGroupFragment( 2448var project = ObjectModelHelpers.CreateInMemoryProject(content); 2462string content = ObjectModelHelpers.FormatProjectContentsWithItemGroupFragment( 2480var project = ObjectModelHelpers.CreateInMemoryProject(content); 2512string content = ObjectModelHelpers.FormatProjectContentsWithItemGroupFragment( 2525var project = ObjectModelHelpers.CreateInMemoryProject(content); 2556var project = ObjectModelHelpers.CreateInMemoryProject(env.CreateProjectCollection().Collection, content); 2593var project = ObjectModelHelpers.CreateInMemoryProject(env.CreateProjectCollection().Collection, content); 2611string content = ObjectModelHelpers.FormatProjectContentsWithItemGroupFragment( 2624var project = ObjectModelHelpers.CreateInMemoryProject(content); 2642string content = ObjectModelHelpers.FormatProjectContentsWithItemGroupFragment( 2655Project project = ObjectModelHelpers.CreateInMemoryProject(content); 2666string content = ObjectModelHelpers.FormatProjectContentsWithItemGroupFragment( 2684Project project = ObjectModelHelpers.CreateInMemoryProject(content); 2692string content = ObjectModelHelpers.FormatProjectContentsWithItemGroupFragment( 2704Should.Throw<InvalidProjectFileException>(() => ObjectModelHelpers.CreateInMemoryProject(content)) 2722IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment(content); 2724ObjectModelHelpers.AssertItemHasMetadata( 2734ObjectModelHelpers.AssertItemHasMetadata( 2760var project = ObjectModelHelpers.CreateInMemoryProject(ObjectModelHelpers.FormatProjectContentsWithItemGroupFragment(projectContents)); 2774ObjectModelHelpers.AssertItemHasMetadata(expectedUpdateFromTrue, items[0]); 2775ObjectModelHelpers.AssertItemHasMetadata(expectedInitial, items[1]); 2776ObjectModelHelpers.AssertItemHasMetadata(expectedInitial, items[2]); 2802var project = ObjectModelHelpers.CreateInMemoryProject(ObjectModelHelpers.FormatProjectContentsWithItemGroupFragment(projectContents)); 2816ObjectModelHelpers.AssertItemHasMetadata(expectedInitial, itemsIgnoringCondition[0]); 2817ObjectModelHelpers.AssertItemHasMetadata(expectedInitial, itemsIgnoringCondition[1]); 2818ObjectModelHelpers.AssertItemHasMetadata(expectedInitial, itemsIgnoringCondition[2]); 2819ObjectModelHelpers.AssertItemHasMetadata(expectedUpdateFromUnconditionedElement, itemsIgnoringCondition[3]); 2835IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment(content); 2842ObjectModelHelpers.AssertItemHasMetadata(expectedUpdate, items[0]); 2872IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment(contents, allItems: true); 2882ObjectModelHelpers.AssertItemHasMetadata(expectedUpdatei, items[0]); 2883ObjectModelHelpers.AssertItemHasMetadata(expectedUpdatej, items[1]); 2916IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment(contents, allItems: true); 2917ObjectModelHelpers.AssertItemHasMetadata("m1", "second", items[3]); 2918ObjectModelHelpers.AssertItemHasMetadata("m1", "third", items[4]); 2919ObjectModelHelpers.AssertItemHasMetadata("m1", "fourth", items[5]); 2920ObjectModelHelpers.AssertItemHasMetadata("m1", "sixth", items[6]); 2921ObjectModelHelpers.AssertItemHasMetadata("m1", "sixth", items[7]); 2922ObjectModelHelpers.AssertItemHasMetadata("m1", "sixth", items[8]); 2923ObjectModelHelpers.AssertItemHasMetadata("m1", "sixth", items[9]); 2924ObjectModelHelpers.AssertItemHasMetadata("m1", "seventh", items[10]); 2925ObjectModelHelpers.AssertItemHasMetadata("m1", "sixth", items[11]); 2926ObjectModelHelpers.AssertItemHasMetadata("m1", "sixth", items[12]); 2927ObjectModelHelpers.AssertItemHasMetadata("m1", "seventh", items[13]); 2928ObjectModelHelpers.AssertItemHasMetadata("m1", "eighth", items[14]); 2942IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment(content); 2953ObjectModelHelpers.AssertItemHasMetadata(expectedMetadata, items[0]); 2954ObjectModelHelpers.AssertItemHasMetadata(expectedMetadata, items[1]); 2970IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment(content); 2980ObjectModelHelpers.AssertItemHasMetadata(expectedMetadata, items[0]); 2981ObjectModelHelpers.AssertItemHasMetadata(expectedMetadata, items[1]); 2999ObjectModelHelpers.GetItemsFromFragment(content); 3024IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment(content, true); 3047ObjectModelHelpers.AssertItemHasMetadata(expectedMetadataX, items[0]); 3048ObjectModelHelpers.AssertItemHasMetadata(expectedMetadataA, items[1]); 3049ObjectModelHelpers.AssertItemHasMetadata(expectedMetadataB, items[2]); 3072IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment(content, true); 3096ObjectModelHelpers.AssertItemHasMetadata(expectedMetadataA, items[2]); 3097ObjectModelHelpers.AssertItemHasMetadata(expectedMetadataB, items[3]); 3098ObjectModelHelpers.AssertItemHasMetadata(expectedMetadataC, items[4]); 3107IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment(content, true); 3137IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment(content, true); 3151ObjectModelHelpers.AssertItemHasMetadata(expectedMetadataA, items[1]); 3166IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment(content, true); 3174ObjectModelHelpers.AssertItemHasMetadata(expectedMetadataA, items[1]); 3185IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment(content, true); 3193ObjectModelHelpers.AssertItemHasMetadata(expectedMetadataA, items[0]); 3212IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment(content, true); 3221ObjectModelHelpers.AssertItemHasMetadata(expectedMetadataA, items[2]); 3252IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment(content, true); 3306ObjectModelHelpers.AssertItemHasMetadata(expectedMetadataX, items[6]); 3307ObjectModelHelpers.AssertItemHasMetadata(expectedMetadata2, items[7]); 3308ObjectModelHelpers.AssertItemHasMetadata(expectedMetadataCCC, items[8]); 3309ObjectModelHelpers.AssertItemHasMetadata(expectedMetadata1, items[9]); 3310ObjectModelHelpers.AssertItemHasMetadata(expectedMetadataD, items[10]); 3311ObjectModelHelpers.AssertItemHasMetadata(expectedMetadataY, items[11]); 3339IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment(content, true); 3357ObjectModelHelpers.AssertItemHasMetadata(expectedMetadataA, items[0]); 3358ObjectModelHelpers.AssertItemHasMetadata(expectedMetadataB, items[1]); 3359ObjectModelHelpers.AssertItemHasMetadata(expectedMetadataC, items[2]); 3383var items = ObjectModelHelpers.GetItemsFromFragment(content, true).Where(i => i.ItemType.Equals("to")).ToArray(); 3389ObjectModelHelpers.AssertItemHasMetadata(null, item); 3423ObjectModelHelpers.AssertItemHasMetadata(expectedInitialMetadata, items[0]); 3424ObjectModelHelpers.AssertItemHasMetadata(expectedInitialMetadata, items[1]); 3425ObjectModelHelpers.AssertItemHasMetadata(expectedUpdatedMetadata, items[2]); 3426ObjectModelHelpers.AssertItemHasMetadata(expectedUpdatedMetadata, items[3]); 3448IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment(content, true); 3470ObjectModelHelpers.AssertItemHasMetadata(expected_i1, items[0]); 3471ObjectModelHelpers.AssertItemHasMetadata(expected_i1, items[1]); 3472ObjectModelHelpers.AssertItemHasMetadata(expected_i2_a, items[2]); 3473ObjectModelHelpers.AssertItemHasMetadata(expected_i2_y, items[3]); 3497IList<ProjectItem> items = ObjectModelHelpers.GetItems(content); 3513ObjectModelHelpers.AssertItemHasMetadata(expectedUpdated, items[0]); 3514ObjectModelHelpers.AssertItemHasMetadata(expectedUpdated, items[1]); 3515ObjectModelHelpers.AssertItemHasMetadata(expectedInitial, items[2]); 3532IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment(content); 3542ObjectModelHelpers.AssertItemHasMetadata(expectedUpdated, items[0]); 3634ObjectModelHelpers.AssertItemEvaluationFromProject(formattedProjectContents, Array.Empty<string>(), expectedInclude, expectedMetadata); 3657ObjectModelHelpers.AssertItemEvaluationFromGenericItemEvaluator( 3663.Select(i => (ObjectModelHelpers.ITestItem)new ObjectModelHelpers.ProjectItemTestItemAdapter(i)) 3687IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment(content); 3697ObjectModelHelpers.AssertItemHasMetadata(expectedUpdated, item); 3703var formattedProjectContents = ObjectModelHelpers.FormatProjectContentsWithItemGroupFragment(itemGroupFragment); 3722IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment(fragment); 3734IList<ProjectItem> items = ObjectModelHelpers.GetItems(content);
Definition\ProjectItemDefinition_Tests.cs (20)
38string expected = ObjectModelHelpers.CleanupFileContents( 169ObjectModelHelpers.CleanupFileContents( 199ObjectModelHelpers.CleanupFileContents( 233ObjectModelHelpers.CleanupFileContents( 259ObjectModelHelpers.CleanupFileContents( 286ObjectModelHelpers.CleanupFileContents( 314ObjectModelHelpers.CleanupFileContents( 345ObjectModelHelpers.CleanupFileContents( 375ObjectModelHelpers.CleanupFileContents( 403ObjectModelHelpers.CleanupFileContents( 432ObjectModelHelpers.CleanupFileContents( 476ObjectModelHelpers.CleanupFileContents( 498ObjectModelHelpers.CleanupFileContents( 520ObjectModelHelpers.CleanupFileContents( 542ObjectModelHelpers.CleanupFileContents( 564ObjectModelHelpers.CleanupFileContents( 586ObjectModelHelpers.CleanupFileContents( 608ObjectModelHelpers.CleanupFileContents( 630ObjectModelHelpers.CleanupFileContents( 649ObjectModelHelpers.CleanupFileContents(
Definition\ProjectMetadata_Tests.cs (13)
42string content = ObjectModelHelpers.CleanupFileContents(@" 68string expected = ObjectModelHelpers.CleanupFileContents(@" 146string content = ObjectModelHelpers.CleanupFileContents(@" 175string content = ObjectModelHelpers.CleanupFileContents(@" 202string content = ObjectModelHelpers.CleanupFileContents(@" 228string content = ObjectModelHelpers.CleanupFileContents(@" 256string content = ObjectModelHelpers.CleanupFileContents(@" 288string content = ObjectModelHelpers.CleanupFileContents(@" 321string content = ObjectModelHelpers.CleanupFileContents(@" 351string content = ObjectModelHelpers.CleanupFileContents(@" 384string content = ObjectModelHelpers.CleanupFileContents(@" 415string content = ObjectModelHelpers.CleanupFileContents(@" 484string projectString = ObjectModelHelpers.CleanupFileContents(@"<Project DefaultTargets=""Build"" ToolsVersion=""msbuilddefaulttoolsversion"" xmlns=""msbuildnamespace"">
Instance\ProjectInstance_Tests.cs (8)
531string projectA = Path.Combine(ObjectModelHelpers.TempProjectDir, "a.proj"); 532string projectB = Path.Combine(ObjectModelHelpers.TempProjectDir, "b.proj"); 534string includeFileA = Path.Combine(ObjectModelHelpers.TempProjectDir, "aaa4.cs"); 535string includeFileB = Path.Combine(ObjectModelHelpers.TempProjectDir, "bbb4.cs"); 629File.WriteAllText(projectA, ObjectModelHelpers.CleanupFileContents(contentsA)); 630File.WriteAllText(projectB, ObjectModelHelpers.CleanupFileContents(contentsB)); 636ObjectModelHelpers.BuildTempProjectFileExpectSuccess("a.proj", logger); 1030using ProjectFromString projectFromString = new(content, globalProperties, ObjectModelHelpers.MSBuildDefaultToolsVersion, ProjectCollection.GlobalProjectCollection);
ObjectModelRemoting\Helpers\TestCollectionGroup.cs (2)
15public static string SampleProjectFile = ObjectModelHelpers.CleanupFileContents(@" 39public static string BigProjectFile = ObjectModelHelpers.CleanupFileContents(@"
ObjectModelRemoting\RemoteProjectsProviderMock\ExporterMock.cs (1)
172content = ObjectModelHelpers.CleanupFileContents(content);
TransientIO.cs (1)
106content = ObjectModelHelpers.CleanupFileContents(content);
Microsoft.Build.Engine.UnitTests (732)
BackEnd\BatchingEngine_Tests.cs (1)
487using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(content));
BackEnd\BuildManager_Logging_Tests.cs (1)
19using static Microsoft.Build.UnitTests.ObjectModelHelpers;
BackEnd\BuildManager_Tests.cs (2)
29using static Microsoft.Build.UnitTests.ObjectModelHelpers; 4395string projectContents = ObjectModelHelpers.CleanupFileContents(@"<Project>
BackEnd\BuildRequestConfiguration_Tests.cs (7)
185using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@"<Project ToolsVersion='msbuilddefaulttoolsversion' xmlns='msbuildnamespace' />")); 263string projectBody = ObjectModelHelpers.CleanupFileContents(@" 282ObjectModelHelpers.MSBuildDefaultToolsVersion, 320string projectBody = ObjectModelHelpers.CleanupFileContents(@" 359ObjectModelHelpers.MSBuildDefaultToolsVersion, 426string projectBody = ObjectModelHelpers.CleanupFileContents(@" 462using ProjectFromString projectFromString = new(projectBody, globalProperties, ObjectModelHelpers.MSBuildDefaultToolsVersion, collection);
BackEnd\BuildRequestEngine_Tests.cs (1)
240string content = ObjectModelHelpers.CleanupFileContents(@"
BackEnd\ConfigurationMetadata_Tests.cs (8)
88BuildRequestData data = new BuildRequestData("file", new Dictionary<string, string>(), ObjectModelHelpers.MSBuildDefaultToolsVersion, Array.Empty<string>(), null); 89BuildRequestConfiguration config = new BuildRequestConfiguration(1, data, ObjectModelHelpers.MSBuildDefaultToolsVersion); 104BuildRequestData data = new BuildRequestData("file", new Dictionary<string, string>(), ObjectModelHelpers.MSBuildDefaultToolsVersion, Array.Empty<string>(), null); 105BuildRequestConfiguration config = new BuildRequestConfiguration(1, data, ObjectModelHelpers.MSBuildDefaultToolsVersion); 113data = new BuildRequestData("file2", new Dictionary<string, string>(), ObjectModelHelpers.MSBuildDefaultToolsVersion, Array.Empty<string>(), null); 114BuildRequestConfiguration config2 = new BuildRequestConfiguration(1, data, ObjectModelHelpers.MSBuildDefaultToolsVersion); 146string projectBody = ObjectModelHelpers.CleanupFileContents(@" 153using ProjectFromString projectFromString = new(projectBody, globalProperties, ObjectModelHelpers.MSBuildDefaultToolsVersion);
BackEnd\GenerateTemporaryTargetAssembly_Tests.cs (1)
27MockLogger logger = ObjectModelHelpers.BuildProjectExpectFailure(@$"
BackEnd\IntrinsicTask_Tests.cs (155)
31string content = ObjectModelHelpers.CleanupFileContents(@" 52string content = ObjectModelHelpers.CleanupFileContents(@" 71string content = ObjectModelHelpers.CleanupFileContents(@" 89string content = ObjectModelHelpers.CleanupFileContents(@" 107string content = ObjectModelHelpers.CleanupFileContents( 123string content = ObjectModelHelpers.CleanupFileContents( 145string content = ObjectModelHelpers.CleanupFileContents( 162string content = ObjectModelHelpers.CleanupFileContents( 179var content = ObjectModelHelpers.CleanupFileContents( 196content = ObjectModelHelpers.CleanupFileContents( 216var content = ObjectModelHelpers.CleanupFileContents( 236string content = ObjectModelHelpers.CleanupFileContents(@" 280string content = ObjectModelHelpers.CleanupFileContents(@" 300string content = ObjectModelHelpers.CleanupFileContents(@" 320string content = ObjectModelHelpers.CleanupFileContents(""" 341string content = ObjectModelHelpers.CleanupFileContents(@" 361string content = ObjectModelHelpers.CleanupFileContents(@" 382string content = ObjectModelHelpers.CleanupFileContents(@" 406string content = ObjectModelHelpers.CleanupFileContents(@" 431string content = ObjectModelHelpers.CleanupFileContents(@" 453string content = ObjectModelHelpers.CleanupFileContents(@" 480string content = ObjectModelHelpers.CleanupFileContents(@" 506string content = ObjectModelHelpers.CleanupFileContents(@" 532string content = ObjectModelHelpers.CleanupFileContents(@" 561string content = ObjectModelHelpers.CleanupFileContents(@" 583string content = ObjectModelHelpers.CleanupFileContents(@" 609string content = ObjectModelHelpers.CleanupFileContents(@" 635string content = ObjectModelHelpers.CleanupFileContents(@" 666string content = ObjectModelHelpers.CleanupFileContents(@" 690string content = ObjectModelHelpers.CleanupFileContents(@" 709string content = ObjectModelHelpers.CleanupFileContents(@" 736string content = ObjectModelHelpers.CleanupFileContents(@" 760string content = ObjectModelHelpers.CleanupFileContents(@" 776string content = ObjectModelHelpers.CleanupFileContents(@" 794string content = ObjectModelHelpers.CleanupFileContents(@" 809string content = ObjectModelHelpers.CleanupFileContents(@" 831string content = ObjectModelHelpers.CleanupFileContents(@" 854string content = ObjectModelHelpers.CleanupFileContents(@" 876string content = ObjectModelHelpers.CleanupFileContents(@" 903var content = ObjectModelHelpers.CleanupFileContents( 920content = ObjectModelHelpers.CleanupFileContents( 941var content = ObjectModelHelpers.CleanupFileContents( 965string content = ObjectModelHelpers.CleanupFileContents(@" 988string content = ObjectModelHelpers.CleanupFileContents(@" 1011string content = ObjectModelHelpers.CleanupFileContents(@" 1044string content = ObjectModelHelpers.CleanupFileContents( 1077var content = ObjectModelHelpers.CleanupFileContents( 1105string content = ObjectModelHelpers.CleanupFileContents( 1138string content = ObjectModelHelpers.CleanupFileContents( 1161var content = ObjectModelHelpers.CleanupFileContents( 1192string content = ObjectModelHelpers.CleanupFileContents( 1211using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 1234using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 1260using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 1276"), globalProperties, ObjectModelHelpers.MSBuildDefaultToolsVersion); 1298using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 1328using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 1348using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 1370using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 1390using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 1412using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 1437using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 1465oldFiles = ObjectModelHelpers.GetTempFiles(2, new DateTime(2005, 1, 1)); 1466newFiles = ObjectModelHelpers.GetTempFiles(2, new DateTime(2006, 1, 1)); 1469using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 1495ObjectModelHelpers.DeleteTempFiles(oldFiles); 1496ObjectModelHelpers.DeleteTempFiles(newFiles); 1507oldFiles = ObjectModelHelpers.GetTempFiles(2, new DateTime(2005, 1, 1)); 1508newFiles = ObjectModelHelpers.GetTempFiles(2, new DateTime(2006, 1, 1)); 1511using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 1538ObjectModelHelpers.DeleteTempFiles(oldFiles); 1539ObjectModelHelpers.DeleteTempFiles(newFiles); 1550oldFiles = ObjectModelHelpers.GetTempFiles(2, new DateTime(2005, 1, 1)); 1551newFiles = ObjectModelHelpers.GetTempFiles(2, new DateTime(2006, 1, 1)); 1558using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 1596ObjectModelHelpers.DeleteTempFiles(oldFiles); 1597ObjectModelHelpers.DeleteTempFiles(newFiles); 1606string content = ObjectModelHelpers.CleanupFileContents( 1620string content = ObjectModelHelpers.CleanupFileContents( 1637string content = ObjectModelHelpers.CleanupFileContents( 1660using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 1699string content = ObjectModelHelpers.CleanupFileContents( 1718string content = ObjectModelHelpers.CleanupFileContents( 1737string content = ObjectModelHelpers.CleanupFileContents( 1756string content = ObjectModelHelpers.CleanupFileContents( 1790string content = ObjectModelHelpers.CleanupFileContents( 1827string content = ObjectModelHelpers.CleanupFileContents( 1885string content = ObjectModelHelpers.CleanupFileContents( 1919string content = ObjectModelHelpers.CleanupFileContents( 1955string content = ObjectModelHelpers.CleanupFileContents( 1995string content = ObjectModelHelpers.CleanupFileContents( 2033string content = ObjectModelHelpers.CleanupFileContents( 2063string content = ObjectModelHelpers.CleanupFileContents( 2095string content = ObjectModelHelpers.CleanupFileContents( 2135string content = ObjectModelHelpers.CleanupFileContents( 2176string content = ObjectModelHelpers.CleanupFileContents(@" 2215string content = ObjectModelHelpers.CleanupFileContents(@" 2255string content = ObjectModelHelpers.CleanupFileContents(@" 2284using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 2317using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 2350using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 2388using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 2428using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 2463using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 2493using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 2531string content = ObjectModelHelpers.CleanupFileContents(@" 2553using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 2578using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 2609using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 2651using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 2696using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 2740using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 2785using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 2823string content = ObjectModelHelpers.CleanupFileContents( 2840string content = ObjectModelHelpers.CleanupFileContents( 2864using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 2896string content = ObjectModelHelpers.CleanupFileContents( 2922using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 2946string content = ObjectModelHelpers.CleanupFileContents( 2976string content = ObjectModelHelpers.CleanupFileContents( 3008string content = ObjectModelHelpers.CleanupFileContents( 3025string content = ObjectModelHelpers.CleanupFileContents( 3056string content = ObjectModelHelpers.CleanupFileContents( 3100string content = ObjectModelHelpers.CleanupFileContents(@" 3128using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 3179using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 3220using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 3275using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 3302using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 3350using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 3386File.WriteAllText(importedFile, ObjectModelHelpers.CleanupFileContents(@" 3393using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 3412ObjectModelHelpers.DeleteTempFiles(new string[] { importedFile }); 3425File.WriteAllText(importedFile, ObjectModelHelpers.CleanupFileContents(@" 3432using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 3452ObjectModelHelpers.DeleteTempFiles(new string[] { importedFile }); 3463using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 3495using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 3520using ProjectRootElementFromString projectRootElementFromString = new(ObjectModelHelpers.CleanupFileContents(@" 3556files = ObjectModelHelpers.GetTempFiles(2, new DateTime(2005, 1, 1)); 3559using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 3586ObjectModelHelpers.DeleteTempFiles(files); 3594using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 3623using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 3654using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 3681using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 3710using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 3739using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 3768using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 3805using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 3834using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 3864using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 3986ObjectModelHelpers.AssertItemEvaluationFromGenericItemEvaluator((p, c) => 4004return lookup.GetItems(itemType).Select(i => (ObjectModelHelpers.ITestItem)new ObjectModelHelpers.ProjectItemInstanceTestItemAdapter(i)).ToList();
BackEnd\MSBuild_Tests.cs (86)
47string tempProject = ObjectModelHelpers.CreateTempFileOnDisk(@" 82Project p = ObjectModelHelpers.CreateInMemoryProject(parentProjectContents); 105string projectFile1 = ObjectModelHelpers.CreateTempFileOnDisk(@" 118string projectFile2 = ObjectModelHelpers.CreateTempFileOnDisk(@" 141Project p = ObjectModelHelpers.CreateInMemoryProject(parentProjectContents); 161ObjectModelHelpers.AssertItemsMatch(expectedItemOutputs, targetOutputs["Build"].Items, false /* order of items not enforced */); 186Project project = ObjectModelHelpers.CreateInMemoryProject(projectContents, logger); 198ObjectModelHelpers.DeleteTempProjectDirectory(); 199ObjectModelHelpers.CreateFileInTempProjectDirectory( 209ObjectModelHelpers.BuildTempProjectFileExpectFailure(@"SkipNonexistentProjectsMain.csproj", logger); 220ObjectModelHelpers.DeleteTempProjectDirectory(); 221ObjectModelHelpers.CreateFileInTempProjectDirectory( 231ObjectModelHelpers.BuildTempProjectFileExpectFailure(@"SkipNonexistentProjectsMain.csproj", logger); 244ObjectModelHelpers.DeleteTempProjectDirectory(); 245ObjectModelHelpers.CreateFileInTempProjectDirectory( 254ObjectModelHelpers.CreateFileInTempProjectDirectory( 264ObjectModelHelpers.BuildTempProjectFileExpectSuccess(@"SkipNonexistentProjectsMain.csproj", logger); 282ObjectModelHelpers.DeleteTempProjectDirectory(); 283ObjectModelHelpers.CreateFileInTempProjectDirectory( 292ObjectModelHelpers.CreateFileInTempProjectDirectory( 302ObjectModelHelpers.BuildTempProjectFileExpectSuccess(@"SkipNonexistentProjectsMain.csproj", logger); 320ObjectModelHelpers.DeleteTempProjectDirectory(); 321ObjectModelHelpers.CreateFileInTempProjectDirectory( 340ObjectModelHelpers.CreateFileInTempProjectDirectory( 350ObjectModelHelpers.BuildTempProjectFileExpectFailure(@"SkipNonexistentProjectsMain.csproj", logger); 366ObjectModelHelpers.DeleteTempProjectDirectory(); 367ObjectModelHelpers.CreateFileInTempProjectDirectory( 376ObjectModelHelpers.CreateFileInTempProjectDirectory( 385ObjectModelHelpers.CreateFileInTempProjectDirectory( 396ObjectModelHelpers.BuildTempProjectFileExpectFailure(@"BuildingVCProjMain.csproj", logger); 516string projectFile1 = ObjectModelHelpers.CreateTempFileOnDisk(@" 525string projectFile2 = ObjectModelHelpers.CreateTempFileOnDisk(@" 554Project p = ObjectModelHelpers.CreateInMemoryProject(parentProjectContents); 570ObjectModelHelpers.AssertItemsMatch(expectedItemOutputs, targetOutputs["Build"].Items, false /* order of items not enforced */); 585string projectFile1 = ObjectModelHelpers.CreateTempFileOnDisk(@" 594string projectFile2 = ObjectModelHelpers.CreateTempFileOnDisk(@" 623Project p = ObjectModelHelpers.CreateInMemoryProject(parentProjectContents); 637ObjectModelHelpers.AssertItemsMatch(expectedItemOutputs, targetOutputs["Build"].Items, false /* order of items not enforced */); 656projectFile = ObjectModelHelpers.CreateTempFileOnDisk(@" 681ObjectModelHelpers.BuildTempProjectFileExpectSuccess(projectFile, logger); 711projectFile = ObjectModelHelpers.CreateTempFileOnDisk(@" 748ObjectModelHelpers.BuildTempProjectFileExpectSuccess(projectFile, logger); 792var projectFile = env.CreateFile("test.proj", ObjectModelHelpers.CleanupFileContents(projectContent)); 795ObjectModelHelpers.BuildTempProjectFileExpectSuccess(projectFile.Path, logger); 824var projectFile = env.CreateFile(projFileName, ObjectModelHelpers.CleanupFileContents(projectContent)); 827ObjectModelHelpers.BuildTempProjectFileExpectSuccess(projectFile.Path, logger); 871var projectFile = env.CreateFile("test.proj", ObjectModelHelpers.CleanupFileContents(projectContent)); 874ObjectModelHelpers.BuildTempProjectFileExpectSuccess(projectFile.Path, logger); 892string projectFile1 = ObjectModelHelpers.CreateTempFileOnDisk(@" 901string projectFile2 = ObjectModelHelpers.CreateTempFileOnDisk(@" 930Project p = ObjectModelHelpers.CreateInMemoryProject(parentProjectContents); 943ObjectModelHelpers.AssertItemsMatch(expectedItemOutputs, targetOutputs["Build"].Items, false /* order of items not enforced */); 959string projectFile1 = ObjectModelHelpers.CreateTempFileOnDisk(@" 968string projectFile2 = ObjectModelHelpers.CreateTempFileOnDisk(@" 997Project p = ObjectModelHelpers.CreateInMemoryProject(parentProjectContents); 1014string projectFile1 = ObjectModelHelpers.CreateTempFileOnDisk(@" 1023string projectFile2 = ObjectModelHelpers.CreateTempFileOnDisk(@" 1050Project p = ObjectModelHelpers.CreateInMemoryProject(parentProjectContents); 1065ObjectModelHelpers.AssertItemsMatch(expectedItemOutputs, targetOutputs["Build"].Items, false /* order of items not enforced */); 1081string projectFile1 = ObjectModelHelpers.CreateTempFileOnDisk(@" 1090string projectFile2 = ObjectModelHelpers.CreateTempFileOnDisk(@" 1119Project p = ObjectModelHelpers.CreateInMemoryProject(parentProjectContents); 1134ObjectModelHelpers.AssertItemsMatch(expectedItemOutputs, targetOutputs["Build"].Items, false /* order of items not enforced */); 1150string projectFile1 = ObjectModelHelpers.CreateTempFileOnDisk(@" 1159string projectFile2 = ObjectModelHelpers.CreateTempFileOnDisk(@" 1186Project p = ObjectModelHelpers.CreateInMemoryProject(parentProjectContents); 1200ObjectModelHelpers.AssertItemsMatch(expectedItemOutputs, targetOutputs["Build"].Items, false /* order of items not enforced */); 1215string projectFile1 = ObjectModelHelpers.CreateTempFileOnDisk(@" 1223string projectFile2 = ObjectModelHelpers.CreateTempFileOnDisk(@" 1254Project p = ObjectModelHelpers.CreateInMemoryProject(parentProjectContents); 1274string project1 = ObjectModelHelpers.CreateTempFileOnDisk(@" 1282string project2 = ObjectModelHelpers.CreateTempFileOnDisk(@" 1340Project p = ObjectModelHelpers.CreateInMemoryProject(parentProjectContents, logger); 1526string project1 = ObjectModelHelpers.CreateTempFileOnDisk(@" 1534string project2 = ObjectModelHelpers.CreateTempFileOnDisk(@" 1559Project p = ObjectModelHelpers.CreateInMemoryProject(pc, parentProjectContents, logger); 1580Project p2 = ObjectModelHelpers.CreateInMemoryProject(pc, parentProjectContents, logger2); 1598string project1 = ObjectModelHelpers.CreateTempFileOnDisk(@" 1689Project p = ObjectModelHelpers.CreateInMemoryProject(parentProjectContents, logger); 1752string projectFile1 = ObjectModelHelpers.CreateTempFileOnDisk(@" 1758string projectFile2 = ObjectModelHelpers.CreateTempFileOnDisk(@" 1801Project p = ObjectModelHelpers.CreateInMemoryProject(parentProjectContents); 1830string projectFile1 = ObjectModelHelpers.CreateTempFileOnDisk(@" 1836string projectFile2 = ObjectModelHelpers.CreateTempFileOnDisk(@" 1866string projectFile1 = ObjectModelHelpers.CreateTempFileOnDisk(@" 1872string projectFile2 = ObjectModelHelpers.CreateTempFileOnDisk(@"
BackEnd\OnError_Tests.cs (17)
36using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 146using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 191using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 223using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 257using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 290using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 322using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 347using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 375using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 403using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 436using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 478using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 503using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 533using ProjectFromString projectFromString = new(ObjectModelHelpers.CleanupFileContents(@" 559Project p = new Project(XmlReader.Create(new StringReader(ObjectModelHelpers.CleanupFileContents(@" 581MockLogger logger = ObjectModelHelpers.BuildProjectExpectFailure($@" 772return String.Format(ObjectModelHelpers.CleanupFileContents(@"
BackEnd\RequestBuilder_Tests.cs (4)
161ObjectModelHelpers.AssertArrayContentsMatch(_newBuildRequests_FQRequests, newRequest); 200ObjectModelHelpers.AssertArrayContentsMatch(_newBuildRequests_FQRequests, newRequest); 262? ObjectModelHelpers.MSBuildDefaultToolsVersion 270ObjectModelHelpers.MSBuildDefaultToolsVersion,
BackEnd\Scheduler_Tests.cs (1)
704string contents = ObjectModelHelpers.CleanupFileContents(@"
BackEnd\SdkResultOutOfProc_Tests.cs (1)
20using static Microsoft.Build.UnitTests.ObjectModelHelpers;
BackEnd\TargetEntry_Tests.cs (2)
860ObjectModelHelpers.MSBuildDefaultToolsVersion, 877ObjectModelHelpers.MSBuildDefaultToolsVersion,
BackEnd\TargetUpToDateChecker_Tests.cs (15)
39ObjectModelHelpers.DeleteTempProjectDirectory(); 48var content = ObjectModelHelpers.CleanupFileContents( 78var content = ObjectModelHelpers.CleanupFileContents( 104var content = ObjectModelHelpers.CleanupFileContents( 131content = ObjectModelHelpers.CleanupFileContents( 303string projectText = ObjectModelHelpers.CleanupFileContents(@" 332string projectText = ObjectModelHelpers.CleanupFileContents(@" 361string projectText = ObjectModelHelpers.CleanupFileContents(@" 391string projectText = ObjectModelHelpers.CleanupFileContents(@" 426string projectText = ObjectModelHelpers.CleanupFileContents(@" 467Directory.SetCurrentDirectory(ObjectModelHelpers.TempProjectDir); 469var content = ObjectModelHelpers.CleanupFileContents(@" 581string path = ObjectModelHelpers.CreateFileInTempProjectDirectory(filesToAnalyze[i].Path, ""); 591string unformattedProjectXml = ObjectModelHelpers.CleanupFileContents( 599string projectFile = Path.Combine(ObjectModelHelpers.TempProjectDir, "temp.proj");
BackEnd\TaskBuilder_Tests.cs (24)
71string projectFileContents = ObjectModelHelpers.CleanupFileContents( 93string projectFileContents = ObjectModelHelpers.CleanupFileContents( 124string projectFileContents = ObjectModelHelpers.CleanupFileContents( 216string projectFileContents = ObjectModelHelpers.CleanupFileContents( 259files = ObjectModelHelpers.GetTempFiles(2, new DateTime(2005, 1, 1)); 262string projectFileContents = ObjectModelHelpers.CleanupFileContents( 308ObjectModelHelpers.DeleteTempFiles(files); 319string projectFileContents = ObjectModelHelpers.CleanupFileContents(@" 383string projectFileContents = ObjectModelHelpers.CleanupFileContents(@" 439string projectFileContents = ObjectModelHelpers.CleanupFileContents($@" 469string projectFileContents = ObjectModelHelpers.CleanupFileContents(@" 495string projectFileContents = ObjectModelHelpers.CleanupFileContents(@" 520string projectFileContents = ObjectModelHelpers.CleanupFileContents(@" 551string projectFileContents = ObjectModelHelpers.CleanupFileContents(@" 594MockLogger logger = ObjectModelHelpers.BuildProjectExpectSuccess(projectContents, _testOutput, LoggerVerbosity.Diagnostic); 618MockLogger logger = ObjectModelHelpers.BuildProjectExpectSuccess(projectContents, _testOutput, LoggerVerbosity.Diagnostic); 644MockLogger logger = ObjectModelHelpers.BuildProjectExpectSuccess(projectContents, _testOutput, LoggerVerbosity.Diagnostic); 673MockLogger logger = ObjectModelHelpers.BuildProjectExpectSuccess(projectContents, _testOutput); 969string projectAPath = Path.Combine(ObjectModelHelpers.TempProjectDir, "a.proj"); 970string projectBPath = Path.Combine(ObjectModelHelpers.TempProjectDir, "b.proj"); 1007File.WriteAllText(projectAPath, ObjectModelHelpers.CleanupFileContents(projectAContents)); 1008File.WriteAllText(projectBPath, ObjectModelHelpers.CleanupFileContents(projectBContents)); 1011ObjectModelHelpers.BuildTempProjectFileExpectSuccess("a.proj", logger); 1183string projectFileContents = ObjectModelHelpers.CleanupFileContents(@"
BackEnd\TaskExecutionHost_Tests.cs (4)
1041MockLogger ml = ObjectModelHelpers.BuildProjectExpectSuccess($""" 1072ObjectModelHelpers.BuildProjectExpectFailure($""" 1102MockLogger ml = ObjectModelHelpers.BuildProjectExpectSuccess($""" 1505string projectFileContents = ObjectModelHelpers.CleanupFileContents(@"
BackEnd\TaskRegistry_Tests.cs (1)
660var testProject = env.CreateTestProjectWithFiles(ObjectModelHelpers.CleanupFileContents(proj));
BinaryLogger_Tests.cs (6)
124Project project = ObjectModelHelpers.CreateInMemoryProject(collection, projectText); 220Project project = ObjectModelHelpers.CreateInMemoryProject(collection, projectText); 329ObjectModelHelpers.BuildProjectExpectSuccess(s_testProject, binaryLogger); 458ObjectModelHelpers.BuildProjectExpectSuccess(testProject, binaryLogger); 518ObjectModelHelpers.BuildProjectExpectSuccess(testProject, binaryLogger); 556ObjectModelHelpers.BuildProjectExpectSuccess(project, binaryLogger);
ConsoleLogger_Tests.cs (10)
183ObjectModelHelpers.BuildProjectExpectSuccess(s_dummyProjectContents, logger); 327ObjectModelHelpers.BuildProjectExpectSuccess(@" 353ObjectModelHelpers.BuildProjectExpectSuccess(s_dummyProjectContents, logger); 370ObjectModelHelpers.BuildProjectExpectSuccess(s_dummyProjectContents, logger); 390ObjectModelHelpers.BuildTempProjectFileWithTargets(tempProjectPath, null, null, logger); 416ObjectModelHelpers.BuildProjectExpectSuccess(s_dummyProjectContents, logger); 423ObjectModelHelpers.BuildProjectExpectSuccess(s_dummyProjectContents, logger); 430ObjectModelHelpers.BuildProjectExpectSuccess(s_dummyProjectContents, logger); 437ObjectModelHelpers.BuildProjectExpectSuccess(s_dummyProjectContents, logger); 444ObjectModelHelpers.BuildProjectExpectSuccess(s_dummyProjectContents, logger);
Construction\ElementLocation_Tests.cs (3)
107File.WriteAllText(file, ObjectModelHelpers.CleanupFileContents("<Project xmlns='msbuildnamespace' ToolsVersion='msbuilddefaulttoolsversion'>\r\n<ItemGroup>") + new string(' ', 70000) + @"<x/></ItemGroup></Project>"); 142File.WriteAllText(file, ObjectModelHelpers.CleanupFileContents("<Project xmlns='msbuildnamespace' ToolsVersion='msbuilddefaulttoolsversion'>\r\n<ItemGroup>") + longstring + @" <x/></ItemGroup></Project>"); 303string content = ObjectModelHelpers.CleanupFileContents(@"
Construction\ProjectRootElement_Tests.cs (4)
31ObjectModelHelpers.CreateFileInTempProjectDirectory(Guid.NewGuid().ToString("N"), contents, Encoding.UTF8) : 32ObjectModelHelpers.CreateFileInTempProjectDirectory(Guid.NewGuid().ToString("N"), contents); 51ObjectModelHelpers.CreateFileInTempProjectDirectory(Guid.NewGuid().ToString("N"), contents, Encoding.UTF8) : 52ObjectModelHelpers.CreateFileInTempProjectDirectory(Guid.NewGuid().ToString("N"), contents);
Construction\SolutionFile_OldParser_Tests.cs (1)
245string genericProj = ObjectModelHelpers.CleanupFileContents(@"
Construction\SolutionProjectGenerator_Tests.cs (38)
305projectXml.ToolsVersion = ObjectModelHelpers.MSBuildDefaultToolsVersion; 440Assert.Equal(ObjectModelHelpers.MSBuildDefaultToolsVersion, instances[0].ToolsVersion); 484Assert.Equal(ObjectModelHelpers.MSBuildDefaultToolsVersion, instances[0].ToolsVersion); 521Assert.Equal(ObjectModelHelpers.MSBuildDefaultToolsVersion, instances[0].ToolsVersion); 532string classLibraryContentsToolsV4 = ObjectModelHelpers.CleanupFileContents( 541string classLibraryContentsToolsV12 = ObjectModelHelpers.CleanupFileContents( 614string[] logoutputs = { ".[11.0]. .[4.0].", ".[11.0]. .[4.0].", String.Format(".[{0}]. .[{0}].", ObjectModelHelpers.MSBuildDefaultToolsVersion) }; 625string solutionFile = ObjectModelHelpers.CreateFileInTempProjectDirectory("Foo.sln", solutions[i]); 626string projectFile = ObjectModelHelpers.CreateFileInTempProjectDirectory("ClassLibrary1.csproj", projects[i]); 644string solutionFileMultipleProjects = ObjectModelHelpers.CreateFileInTempProjectDirectory("Foo.sln", solutionFileContentsDev12MultipleProjects); 645string projectFileV4 = ObjectModelHelpers.CreateFileInTempProjectDirectory("ClassLibrary1.csproj", classLibraryContentsToolsV4); 646string projectFileV12 = ObjectModelHelpers.CreateFileInTempProjectDirectory("ClassLibrary2.csproj", classLibraryContentsToolsV12); 661logger1.AssertLogContains(String.Format(".[{0}]. .[{0}].", ObjectModelHelpers.MSBuildDefaultToolsVersion)); 689string projectFile = ObjectModelHelpers.CreateFileInTempProjectDirectory("ClassLibrary1.csproj", classLibraryContents); 710string solutionFile = ObjectModelHelpers.CreateFileInTempProjectDirectory("Foo.sln", solutionFileContents); 719Assert.Equal(ObjectModelHelpers.MSBuildDefaultToolsVersion, instances[0].ToolsVersion); 728logger.AssertLogContains(String.Format(".[{0}].", ObjectModelHelpers.MSBuildDefaultToolsVersion)); 732ObjectModelHelpers.DeleteTempProjectDirectory(); 1044var solutionFile = ObjectModelHelpers.CreateFileInTempProjectDirectory("MSBuildIssue.sln", solutionFileContents); 1045ObjectModelHelpers.CreateFileInTempProjectDirectory("B.csproj", projectBravoFileContents); 1046ObjectModelHelpers.CreateFileInTempProjectDirectory("C.csproj", projectCharlieFileContents); 1047ObjectModelHelpers.CreateFileInTempProjectDirectory("D.csproj", projectDeltaFileContents); 1057var automaticProjectFile = ObjectModelHelpers.CreateFileInTempProjectDirectory("automatic.msbuild", automaticProjectFileContents); 1274var instance = SolutionProjectGenerator.Generate(solution, null, ObjectModelHelpers.MSBuildDefaultToolsVersion, _buildEventContext, CreateMockLoggingService())[0]; 1342ProjectInstance[] instances = SolutionProjectGenerator.Generate(solution, null, ObjectModelHelpers.MSBuildDefaultToolsVersion, _buildEventContext, CreateMockLoggingService()); 2130BuildRequestData request = new BuildRequestData(projectFilePath, globalProperties, ObjectModelHelpers.MSBuildDefaultToolsVersion, Array.Empty<string>(), null); 2218BuildRequestData request = new BuildRequestData(projectFilePath, globalProperties, ObjectModelHelpers.MSBuildDefaultToolsVersion, Array.Empty<string>(), null); 2510string solutionFilePath = ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine(baseDirectory, $"{Guid.NewGuid():N}.sln"), 2530ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine(baseDirectory, $"after.{Path.GetFileName(solutionFilePath)}.targets"), 2557ObjectModelHelpers.DeleteTempProjectDirectory(); 2569string solutionFilePath = ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine(baseDirectory, $"{Guid.NewGuid():N}.sln"), 2589ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine(baseDirectory, $"after.{Path.GetFileName(solutionFilePath)}.targets"), 2624ObjectModelHelpers.DeleteTempProjectDirectory(); 2647string solutionFilePath = ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine(baseDirectory, $"{Guid.NewGuid():N}.sln"), 2667string projectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine(baseDirectory, projectName), 2679ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine(baseDirectory, "Directory.Solution.props"), 2688ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine(baseDirectory, "Directory.Solution.targets"), 2729ObjectModelHelpers.DeleteTempProjectDirectory();
Definition\ItemDefinitionGroup_Tests.cs (1)
1244ObjectModelHelpers.DeleteTempFiles(new string[] { importedFile });
Definition\Project_Internal_Tests.cs (3)
153var project = ObjectModelHelpers.CreateInMemoryProject("<Project></Project>"); 190project.Xml.ToolsVersion = ObjectModelHelpers.MSBuildDefaultToolsVersion; 196ObjectModelHelpers.MSBuildDefaultToolsVersion,
Definition\ProjectEvaluationContext_Tests.cs (7)
390ObjectModelHelpers.AssertItems(expectedGlobExpansion, project.GetItems("i")); 468ObjectModelHelpers.AssertItems(expectedGlobExpansion, project.GetItems("i")); 525ObjectModelHelpers.AssertItems(expectedGlobExpansion, actualGlobExpansion); 596ObjectModelHelpers.AssertItems(expectedGlobExpansion, actualGlobExpansion); 656ObjectModelHelpers.AssertItems(expectedGlobExpansion, actualGlobExpansion); 738ObjectModelHelpers.AssertItems(expectedGlobExpansion, project.GetItems("i")); 775ObjectModelHelpers.AssertItems(expectedGlobExpansion, project.GetItems("i"));
Definition\ProjectItem_Tests.cs (1)
50ObjectModelHelpers.CleanupFileContents(@"
Definition\Toolset_Tests.cs (11)
199Toolset parentToolset = projectCollection.GetToolset(ObjectModelHelpers.MSBuildDefaultToolsVersion); 233Toolset parentToolset = projectCollection.GetToolset(ObjectModelHelpers.MSBuildDefaultToolsVersion); 267Toolset parentToolset = projectCollection.GetToolset(ObjectModelHelpers.MSBuildDefaultToolsVersion); 289Toolset parentToolset = projectCollection.GetToolset(ObjectModelHelpers.MSBuildDefaultToolsVersion); 311Toolset parentToolset = projectCollection.GetToolset(ObjectModelHelpers.MSBuildDefaultToolsVersion); 339Toolset parentToolset = projectCollection.GetToolset(ObjectModelHelpers.MSBuildDefaultToolsVersion); 364globalProperties.Add("VisualStudioVersion", ObjectModelHelpers.CurrentVisualStudioVersion); 368Assert.Equal(ObjectModelHelpers.CurrentVisualStudioVersion, t.GenerateSubToolsetVersion()); 449Environment.SetEnvironmentVariable("VisualStudioVersion", ObjectModelHelpers.CurrentVisualStudioVersion); 455Toolset parentToolset = projectCollection.GetToolset(ObjectModelHelpers.MSBuildDefaultToolsVersion); 540Toolset parentToolset = projectCollection.GetToolset(ObjectModelHelpers.MSBuildDefaultToolsVersion);
Definition\ToolsetConfigurationReader_Tests.cs (18)
38ToolsetConfigurationReaderTestHelper.WriteConfigFile(ObjectModelHelpers.CleanupFileContents(@" 62ToolsetConfigurationReaderTestHelper.WriteConfigFile(ObjectModelHelpers.CleanupFileContents(@" 98ToolsetConfigurationReaderTestHelper.WriteConfigFile(ObjectModelHelpers.CleanupFileContents(@" 124ToolsetConfigurationReaderTestHelper.WriteConfigFile(ObjectModelHelpers.CleanupFileContents(@" 152ToolsetConfigurationReaderTestHelper.WriteConfigFile(ObjectModelHelpers.CleanupFileContents(@" 204ToolsetConfigurationReaderTestHelper.WriteConfigFile(ObjectModelHelpers.CleanupFileContents(@" 232ToolsetConfigurationReaderTestHelper.WriteConfigFile(ObjectModelHelpers.CleanupFileContents(@" 260ToolsetConfigurationReaderTestHelper.WriteConfigFile(ObjectModelHelpers.CleanupFileContents(@" 288ToolsetConfigurationReaderTestHelper.WriteConfigFile(ObjectModelHelpers.CleanupFileContents(@" 327ToolsetConfigurationReaderTestHelper.WriteConfigFile(ObjectModelHelpers.CleanupFileContents(@" 352ToolsetConfigurationReaderTestHelper.WriteConfigFile(ObjectModelHelpers.CleanupFileContents(@" 377ToolsetConfigurationReaderTestHelper.WriteConfigFile(ObjectModelHelpers.CleanupFileContents(@" 403ToolsetConfigurationReaderTestHelper.WriteConfigFile(ObjectModelHelpers.CleanupFileContents(@" 431ToolsetConfigurationReaderTestHelper.WriteConfigFile(ObjectModelHelpers.CleanupFileContents(@" 466ToolsetConfigurationReaderTestHelper.WriteConfigFile(ObjectModelHelpers.CleanupFileContents(@" 506ToolsetConfigurationReaderTestHelper.WriteConfigFile(ObjectModelHelpers.CleanupFileContents(@" 603ToolsetConfigurationReaderTestHelper.WriteConfigFile(ObjectModelHelpers.CleanupFileContents(@" 638ToolsetConfigurationReaderTestHelper.WriteConfigFile(ObjectModelHelpers.CleanupFileContents(@"
Definition\ToolsetConfigurationReaderTestHelper.cs (1)
26return WriteConfigFile(ObjectModelHelpers.CleanupFileContents(content), null);
Definition\ToolsVersion_Tests.cs (8)
320mockLogger.AssertLogContains(ObjectModelHelpers.CleanupFileContents("ToolsVersion=\"msbuilddefaulttoolsversion\"")); 357mockLogger.AssertLogContains(ObjectModelHelpers.CleanupFileContents("ToolsVersion=\"msbuilddefaulttoolsversion\"")); 392mockLogger.AssertLogContains(ObjectModelHelpers.CleanupFileContents("ToolsVersion=\"msbuilddefaulttoolsversion\"")); 454mockLogger.AssertLogContains(ObjectModelHelpers.CleanupFileContents("ToolsVersion=\"msbuilddefaulttoolsversion\"")); 600mockLogger.AssertLogContains(ObjectModelHelpers.CleanupFileContents("ToolsVersion=\"msbuilddefaulttoolsversion\"")); 642mockLogger.AssertLogContains(ObjectModelHelpers.CleanupFileContents("ToolsVersion=\"msbuilddefaulttoolsversion\"")); 798mockLogger.AssertLogContains(ObjectModelHelpers.CleanupFileContents("ToolsVersion=\"msbuilddefaulttoolsversion\"")); 909mockLogger.AssertLogContains(ObjectModelHelpers.CleanupFileContents("ToolsVersion=\"msbuilddefaulttoolsversion\""));
EscapingInProjects_Tests.cs (21)
219Project project = ObjectModelHelpers.CreateInMemoryProject(projectOriginalContents); 264Project project = ObjectModelHelpers.CreateInMemoryProject(projectOriginalContents); 312Project project = ObjectModelHelpers.CreateInMemoryProject(projectOriginalContents); 320ObjectModelHelpers.DeleteTempProjectDirectory(); 363Project project = ObjectModelHelpers.CreateInMemoryProject(projectOriginalContents); 376ObjectModelHelpers.DeleteTempProjectDirectory(); 430Project project = ObjectModelHelpers.CreateInMemoryProject(projectOriginalContents); 438ObjectModelHelpers.DeleteTempProjectDirectory(); 472Project project = ObjectModelHelpers.CreateInMemoryProject(projectOriginalContents); 514Project project = ObjectModelHelpers.CreateInMemoryProject(projectOriginalContents); 679Project project = ObjectModelHelpers.CreateInMemoryProject(@" 708Project project = ObjectModelHelpers.CreateInMemoryProject(@" 725ObjectModelHelpers.DeleteTempProjectDirectory(); 742Project project = ObjectModelHelpers.CreateInMemoryProject(@" 760ObjectModelHelpers.DeleteTempProjectDirectory(); 776ObjectModelHelpers.CreateInMemoryProject(@" 800Project project = ObjectModelHelpers.CreateInMemoryProject(@" 1802ObjectModelHelpers.DeleteTempProjectDirectory(); 1805File.WriteAllText(Path.Combine(ObjectModelHelpers.TempProjectDir, "a.weirdo"), String.Empty); 1806File.WriteAllText(Path.Combine(ObjectModelHelpers.TempProjectDir, "b.weirdo"), String.Empty); 1807File.WriteAllText(Path.Combine(ObjectModelHelpers.TempProjectDir, "c.weirdo"), String.Empty);
Evaluation\Evaluator_Tests.cs (123)
141string projXml = ObjectModelHelpers.CleanupFileContents(@" 149string fooXml = ObjectModelHelpers.CleanupFileContents(@" 155string barXml = ObjectModelHelpers.CleanupFileContents(@" 312File.WriteAllText(testTargetPath, ObjectModelHelpers.CleanupFileContents(testtargets)); 313File.WriteAllText(subdirProjPath, ObjectModelHelpers.CleanupFileContents(subdirTestProj)); 315File.WriteAllText(targetDirectoryTargetsPath, ObjectModelHelpers.CleanupFileContents(targetDirTargets)); 316File.WriteAllText(targetDirectoryTargetsPath2, ObjectModelHelpers.CleanupFileContents(targetDirTargets2)); 317File.WriteAllText(projectDirectoryTargetsPath, ObjectModelHelpers.CleanupFileContents(projDirTargets)); 318File.WriteAllText(projectDirectoryTargetsPath2, ObjectModelHelpers.CleanupFileContents(projDirTargets2)); 441File.WriteAllText(testTargetPath, ObjectModelHelpers.CleanupFileContents(testtargets)); 442File.WriteAllText(subdirProjPath, ObjectModelHelpers.CleanupFileContents(subdirTestProj)); 444File.WriteAllText(targetDirectoryTargetsPath, ObjectModelHelpers.CleanupFileContents(targetDirTargets)); 445File.WriteAllText(targetDirectoryTargetsPath2, ObjectModelHelpers.CleanupFileContents(targetDirTargets2)); 446File.WriteAllText(projectDirectoryTargetsPath, ObjectModelHelpers.CleanupFileContents(projDirTargets)); 447File.WriteAllText(projectDirectoryTargetsPath2, ObjectModelHelpers.CleanupFileContents(projDirTargets2)); 475string targetA = ObjectModelHelpers.CleanupFileContents(@" 483string targetB = ObjectModelHelpers.CleanupFileContents(@" 491string projectContents = ObjectModelHelpers.CleanupFileContents(@" 535string testtargets = ObjectModelHelpers.CleanupFileContents(@" 578string testtargets = ObjectModelHelpers.CleanupFileContents(@" 624string testtargets = ObjectModelHelpers.CleanupFileContents(@" 667string testtargets = ObjectModelHelpers.CleanupFileContents(@" 712string testtargets = ObjectModelHelpers.CleanupFileContents(@" 757string testtargets = ObjectModelHelpers.CleanupFileContents(@" 812string import = ObjectModelHelpers.CleanupFileContents(@" 824string content = ObjectModelHelpers.CleanupFileContents(@" 877string import = ObjectModelHelpers.CleanupFileContents(@" 885string import2 = ObjectModelHelpers.CleanupFileContents(@" 900string content = ObjectModelHelpers.CleanupFileContents(@" 979string import1 = ObjectModelHelpers.CleanupFileContents(@" 986string import2 = ObjectModelHelpers.CleanupFileContents(@" 999string manifest = ObjectModelHelpers.CleanupFileContents(@" 1041string import1 = ObjectModelHelpers.CleanupFileContents(@" 1048string import2 = ObjectModelHelpers.CleanupFileContents(@" 1061string manifest = ObjectModelHelpers.CleanupFileContents(@" 1131string import1 = ObjectModelHelpers.CleanupFileContents(@" 1139string import2 = ObjectModelHelpers.CleanupFileContents(@" 1177ObjectModelHelpers.CreateTempFileOnDisk(@" 1184ObjectModelHelpers.CreateTempFileOnDisk(@" 1193string content = ObjectModelHelpers.CleanupFileContents($@" 1226ObjectModelHelpers.CreateFileInTempProjectDirectory($"{filename1}-1.props", @" 1232ObjectModelHelpers.CreateFileInTempProjectDirectory($"{filename1}-2.props", @" 1239ObjectModelHelpers.CreateFileInTempProjectDirectory($"{filename2}-1.props", @" 1245ObjectModelHelpers.CreateFileInTempProjectDirectory($"{filename2}-2.props", @" 1251ObjectModelHelpers.CreateFileInTempProjectDirectory($"{filename2}-3.props", @" 1258string content = ObjectModelHelpers.CleanupFileContents($@" 1261<Imports>{ObjectModelHelpers.TempProjectDir}\{filename1}-*.props;{ObjectModelHelpers.TempProjectDir}\{filename2}-*.props</Imports> 1286ObjectModelHelpers.CreateTempFileOnDisk(@" 1295string content = ObjectModelHelpers.CleanupFileContents($@" 1418string content = ObjectModelHelpers.CleanupFileContents(@" 1438string content = ObjectModelHelpers.CleanupFileContents(@" 1466string content = ObjectModelHelpers.CleanupFileContents(@" 1493string content = ObjectModelHelpers.CleanupFileContents(@" 1512string content = ObjectModelHelpers.CleanupFileContents(@" 1543string content = ObjectModelHelpers.CleanupFileContents(@" 1567string content = ObjectModelHelpers.CleanupFileContents(@" 1607string content = ObjectModelHelpers.CleanupFileContents(@" 1642string content = ObjectModelHelpers.CleanupFileContents(@" 1671string content = ObjectModelHelpers.CleanupFileContents(@" 1710string content = ObjectModelHelpers.CleanupFileContents(@" 1739string content = ObjectModelHelpers.CleanupFileContents(@" 1763string content = ObjectModelHelpers.CleanupFileContents(@" 1794string content = ObjectModelHelpers.CleanupFileContents(@" 1830string content = ObjectModelHelpers.CleanupFileContents(@" 1865string content = ObjectModelHelpers.CleanupFileContents(@" 1898string content = ObjectModelHelpers.CleanupFileContents(@" 1981string content = ObjectModelHelpers.CleanupFileContents(@" 2068string content = ObjectModelHelpers.CleanupFileContents(@" 2132string content = ObjectModelHelpers.CleanupFileContents(@" 2157string content = ObjectModelHelpers.CleanupFileContents(@" 2192string content = ObjectModelHelpers.CleanupFileContents(@" 2303string content = ObjectModelHelpers.CleanupFileContents(@" 2328string content = ObjectModelHelpers.CleanupFileContents(@" 2351string content = ObjectModelHelpers.CleanupFileContents(@" 2876string content = ObjectModelHelpers.CleanupFileContents(@" 2902string content = ObjectModelHelpers.CleanupFileContents(@" 2927string content = ObjectModelHelpers.CleanupFileContents(@" 2953string content = ObjectModelHelpers.CleanupFileContents(@" 2983string content = ObjectModelHelpers.CleanupFileContents(@" 3013string content = ObjectModelHelpers.CleanupFileContents(@" 3043string content = ObjectModelHelpers.CleanupFileContents(@" 3079string content = ObjectModelHelpers.CleanupFileContents(@" 3125string content = ObjectModelHelpers.CleanupFileContents(@" 3154string content = ObjectModelHelpers.CleanupFileContents(@" 3190string content = ObjectModelHelpers.CleanupFileContents(@" 3225string content = ObjectModelHelpers.CleanupFileContents(@" 3253string content = ObjectModelHelpers.CleanupFileContents(@" 3295string content = ObjectModelHelpers.CleanupFileContents(@" 3332string content = ObjectModelHelpers.CleanupFileContents(@" 3370string projectContents = ObjectModelHelpers.CleanupFileContents(@" 3380string importContents = ObjectModelHelpers.CleanupFileContents(@" 3430string projectContents = ObjectModelHelpers.CleanupFileContents(@" 3443string importContents = ObjectModelHelpers.CleanupFileContents(@" 3491string projectContents = ObjectModelHelpers.CleanupFileContents(@" 3503string importContents = ObjectModelHelpers.CleanupFileContents(@" 3553string projectContents = ObjectModelHelpers.CleanupFileContents(@" 3570string importContents = ObjectModelHelpers.CleanupFileContents(@" 3627string projectContents = ObjectModelHelpers.CleanupFileContents(@" 3643string importContents = ObjectModelHelpers.CleanupFileContents(@" 3700string projectContents = ObjectModelHelpers.CleanupFileContents(@" 3711string project2Contents = ObjectModelHelpers.CleanupFileContents(@" 3762string projectContents = ObjectModelHelpers.CleanupFileContents(@" 3773string project2Contents = ObjectModelHelpers.CleanupFileContents(@" 3833string content = ObjectModelHelpers.CleanupFileContents(@" 3899string content = ObjectModelHelpers.CleanupFileContents(@" 3951string content = ObjectModelHelpers.CleanupFileContents(@" 4003string content = ObjectModelHelpers.CleanupFileContents(@" 4061string content = ObjectModelHelpers.CleanupFileContents(@" 4119string content = ObjectModelHelpers.CleanupFileContents(@" 4180string content = ObjectModelHelpers.CleanupFileContents(@" 4232string content = ObjectModelHelpers.CleanupFileContents(@" 4279string content = ObjectModelHelpers.CleanupFileContents(@" 4334Project project = new Project(null, ObjectModelHelpers.MSBuildDefaultToolsVersion, collection); 4354string projectContents = ObjectModelHelpers.CleanupFileContents( 4504string projectContents = ObjectModelHelpers.CleanupFileContents(@" 4511string importContents = ObjectModelHelpers.CleanupFileContents(@" 4569string content = ObjectModelHelpers.CleanupFileContents($@" 4677string content = ObjectModelHelpers.CleanupFileContents(@" 4976string projectContents = ObjectModelHelpers.CleanupFileContents(@" 4994string testTargets = ObjectModelHelpers.CleanupFileContents(@" 5042string testtargets = ObjectModelHelpers.CleanupFileContents(@$" 5147Toolset parentToolset = projectCollection.GetToolset(ObjectModelHelpers.MSBuildDefaultToolsVersion);
Evaluation\Expander_Tests.cs (10)
51ObjectModelHelpers.AssertItemsMatch("", GetTaskArrayFromItemList(itemsOut)); 62ObjectModelHelpers.AssertItemsMatch(@"foo", GetTaskArrayFromItemList(itemsOut)); 73ObjectModelHelpers.AssertItemsMatch(@" 104ObjectModelHelpers.AssertItemsMatch(@" 125ObjectModelHelpers.AssertItemsMatch(@" 1429ObjectModelHelpers.AssertItemsMatch(@" 3420MockElementLocation mockElementLocation = new MockElementLocation(Path.Combine(ObjectModelHelpers.TempProjectDir, "one", "two", "three", "four", "five", Path.GetRandomFileName())); 3422string fileToFind = FileUtilities.GetTemporaryFile(ObjectModelHelpers.TempProjectDir, null, ".tmp"); 3441ObjectModelHelpers.DeleteTempProjectDirectory(); 3453ObjectModelHelpers.CreateInMemoryProject("<Project><PropertyGroup><foo>$([MSBuild]::GetPathOfFileAbove('foo'))</foo></PropertyGroup></Project>");
Evaluation\ImportFromMSBuildExtensionsPath_Tests.cs (18)
52mainProjectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("main.proj", GetMainTargetFileContent()); 94string mainProjectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("main.proj", GetMainTargetFileContent()); 128string mainProjectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("main.proj", GetMainTargetFileContent()); 161string mainProjectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("main.proj", mainTargetsFileContent); 202string mainProjectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("main.proj", mainTargetsFileContent); 257string mainProjectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine("extensions2", "circularwildcardtest", "main.proj"), mainTargetsFileContent); 285string mainProjectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("main.proj", GetMainTargetFileContent()); 302mainProjectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("main.proj", GetMainTargetFileContent()); 358string mainProjectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("main.proj", GetMainTargetFileContent()); 402string mainProjectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("main.proj", GetMainTargetFileContent()); 494mainProjectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("main.proj", GetMainTargetFileContent()); 570mainProjectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("main.proj", 631mainProjectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("main.proj", 702mainProjectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("main.proj", mainTargetsFileContent); 767mainProjectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("main.proj", mainTargetsFileContent); 826mainProjectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("main.proj", mainTargetsFileContent); 895mainProjectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("main.proj", GetMainTargetFileContent(extnPathPropertyName)); 1000var extnDir = Path.Combine(ObjectModelHelpers.TempProjectDir, extnDirName);
Evaluation\ItemEvaluation_Tests.cs (31)
59IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment(content, allItems: true); 68ObjectModelHelpers.AssertItems(new[] { "a", "b", "c" }, itemsForI, mI2_1); 77ObjectModelHelpers.AssertItems( 108IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment(content, allItems: true); 117ObjectModelHelpers.AssertItems(new[] { "a", "b", "c" }, itemsForI, expectedMetadata); 120ObjectModelHelpers.AssertItems(Array.Empty<string>(), itemsForI2); 132IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment(content, allItems: true); 134ObjectModelHelpers.AssertItems(new[] { "a", "c" }, items); 150IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment(content, allItems: true); 152ObjectModelHelpers.AssertItems(new[] { "a", "b", "c" }, items, 181IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment(content, allItems: true); 209ObjectModelHelpers.AssertItems(new[] { "a", "b", "c" }, itemsForI, new[] { a, b, c }); 220ObjectModelHelpers.AssertItems(new[] { "a", "b", "c" }, itemsForI2, metadataForI2); 366var items = ObjectModelHelpers.GetItems(projectContent); 368ObjectModelHelpers.AssertItems(expectedItemValues, items, expectedItemMetadata); 387var items = ObjectModelHelpers.GetItems(projectContent, allItems: true); 389ObjectModelHelpers.AssertItems(new[] { "1", "@(A)", "@(A)" }, items); 418var items = ObjectModelHelpers.GetItems(projectContent, allItems: true); 440ObjectModelHelpers.AssertItems(new[] { "1", "B", "C", "D" }, items, expectedMetadata); 459var items = ObjectModelHelpers.GetItems(projectContent); 461ObjectModelHelpers.AssertItems(new[] { "2" }, items); 488IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment(content, allItems: true); 505ObjectModelHelpers.AssertItems(new[] { "i1_1", "i1_3", "i1_4", "i1_6" }, i1Items, i1Metadata); 519ObjectModelHelpers.AssertItems(new[] { "i1_1", "i1_2", "i1_3" }, i2Items, i2Metadata); 523ObjectModelHelpers.AssertItems(new[] { "i1_1", "i1_2", "i1_4" }, i3Items, i1BaseMetadata); 526ObjectModelHelpers.AssertItems(new[] { "i1 has 4 items" }, i_condItems); 543IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment(content.ToString()); 555IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment(content); 688ObjectModelHelpers.AssertItemEvaluationFromProject( 715var items = ObjectModelHelpers.GetItems(projectContent, allItems: true); 725ObjectModelHelpers.AssertItems(new[] { $"{prefix}foo" }, items, expectedMetadata);
Evaluation\Preprocessor_Tests.cs (22)
61string expected = ObjectModelHelpers.CleanupFileContents( 90string expected = ObjectModelHelpers.CleanupFileContents( 134string expected = ObjectModelHelpers.CleanupFileContents( 178string expected = ObjectModelHelpers.CleanupFileContents( 222string expected = ObjectModelHelpers.CleanupFileContents( 270string expected = ObjectModelHelpers.CleanupFileContents( 304string expected = ObjectModelHelpers.CleanupFileContents( 340string one = ObjectModelHelpers.CleanupFileContents( 352string two = ObjectModelHelpers.CleanupFileContents( 376string expected = ObjectModelHelpers.CleanupFileContents( 425string expected = ObjectModelHelpers.CleanupFileContents( 483string expected = ObjectModelHelpers.CleanupFileContents( 556string expected = ObjectModelHelpers.CleanupFileContents( 617string expected = ObjectModelHelpers.CleanupFileContents( 677string expected = ObjectModelHelpers.CleanupFileContents( 733string expected = ObjectModelHelpers.CleanupFileContents( 798string expected = ObjectModelHelpers.CleanupFileContents( 815string content = ObjectModelHelpers.CleanupFileContents(@" 832string expected = ObjectModelHelpers.CleanupFileContents( 888string expected = ObjectModelHelpers.CleanupFileContents( 997string expected = ObjectModelHelpers.CleanupFileContents( 1115string expected = ObjectModelHelpers.CleanupFileContents(
Evaluation\ProjectSdkImplicitImport_Tests.cs (1)
478ProjectRootElement rootElement = ObjectModelHelpers.CreateInMemoryProjectRootElement(projectContents);
EvaluationProfiler_Tests.cs (1)
17using static Microsoft.Build.UnitTests.ObjectModelHelpers;
FileLogger_Tests.cs (5)
31Project project = ObjectModelHelpers.CreateInMemoryProject(@" 338string directory = Path.Combine(ObjectModelHelpers.TempProjectDir, Guid.NewGuid().ToString("N")); 350ObjectModelHelpers.DeleteDirectory(directory); 368Project project = ObjectModelHelpers.CreateInMemoryProject(@" 406Project project = ObjectModelHelpers.CreateInMemoryProject(@"
FileUtilities_Tests.cs (2)
901string filePath = ObjectModelHelpers.CreateFileInTempProjectDirectory("first/second/file.txt", String.Empty); 932string filePath = ObjectModelHelpers.CreateFileInTempProjectDirectory("first/second/file.txt", String.Empty);
FixPathOnUnix_Tests.cs (3)
40string buildProjectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("build.proj", buildProjectContents); 41ObjectModelHelpers.CreateFileInTempProjectDirectory("projectDirectory/main.proj", mainProjectContents); 42ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine("projectDirectory", "lib", "foo.dll"), "just a text file");
Instance\HostServices_Tests.cs (4)
477string contents = ObjectModelHelpers.CleanupFileContents(@" 483using ProjectFromString projectFromString = new(contents, new Dictionary<string, string>(), ObjectModelHelpers.MSBuildDefaultToolsVersion); 496string contents = ObjectModelHelpers.CleanupFileContents(@" 511ObjectModelHelpers.MSBuildDefaultToolsVersion);
Instance\ProjectInstance_Internal_Tests.cs (19)
67string importPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("import.targets", importContent); 81ObjectModelHelpers.DeleteTempProjectDirectory(); 110string import2Path = ObjectModelHelpers.CreateFileInTempProjectDirectory("import2.targets", import2Content); 111string import3Path = ObjectModelHelpers.CreateFileInTempProjectDirectory("import3.targets", import3Content); 114string import1Path = ObjectModelHelpers.CreateFileInTempProjectDirectory("import1.targets", import1Content); 126ObjectModelHelpers.DeleteTempProjectDirectory(); 152ObjectModelHelpers.DeleteTempProjectDirectory(); 282p.Toolset.ToolsVersion.ShouldBe(ObjectModelHelpers.MSBuildDefaultToolsVersion); 325p.Toolset.ToolsVersion.ShouldBe(ObjectModelHelpers.MSBuildDefaultToolsVersion); 359p.Toolset.ToolsVersion.ShouldBe(ObjectModelHelpers.MSBuildDefaultToolsVersion); 387p.Toolset.ToolsVersion.ShouldBe(ObjectModelHelpers.MSBuildDefaultToolsVersion); 426ProjectInstance p = new ProjectInstance(xml, globalProperties, ObjectModelHelpers.MSBuildDefaultToolsVersion, "ABCDEF", collection); 428p.Toolset.ToolsVersion.ShouldBe(ObjectModelHelpers.MSBuildDefaultToolsVersion); 690using ProjectRootElementFromString projectRootElementFromString = new(ObjectModelHelpers.CleanupFileContents(projectContents)); 851string import2Path = ObjectModelHelpers.CreateFileInTempProjectDirectory("import2.targets", import2Content); 852string import3Path = ObjectModelHelpers.CreateFileInTempProjectDirectory("import3.targets", import3Content); 855string import1Path = ObjectModelHelpers.CreateFileInTempProjectDirectory("import1.targets", import1Content); 879ObjectModelHelpers.DeleteTempProjectDirectory(); 968using ProjectFromString projectFromString = new(content, globalProperties, toolsVersion ?? ObjectModelHelpers.MSBuildDefaultToolsVersion, projectCollection ?? ProjectCollection.GlobalProjectCollection);
Instance\TaskItem_Tests.cs (3)
243string content = ObjectModelHelpers.CleanupFileContents(@" 296string content = ObjectModelHelpers.CleanupFileContents(@" 350string content = ObjectModelHelpers.CleanupFileContents(@"
InvalidProjectFileException_Tests.cs (4)
35File.WriteAllText(file, ObjectModelHelpers.CleanupFileContents(@" 44ObjectModelHelpers.BuildTempProjectFileExpectFailure(file, ml); 67File.WriteAllText(file, ObjectModelHelpers.CleanupFileContents(@" 73ObjectModelHelpers.BuildTempProjectFileExpectFailure(file, logger);
Parser_Tests.cs (8)
444MockLogger ml = ObjectModelHelpers.BuildProjectExpectSuccess(@" 455ml = ObjectModelHelpers.BuildProjectExpectSuccess(@" 466ml = ObjectModelHelpers.BuildProjectExpectSuccess(@" 486MockLogger ml = ObjectModelHelpers.BuildProjectExpectSuccess(@" 497ml = ObjectModelHelpers.BuildProjectExpectSuccess(@" 508ml = ObjectModelHelpers.BuildProjectExpectSuccess(@" 519ml = ObjectModelHelpers.BuildProjectExpectSuccess(@" 577var project = ObjectModelHelpers.CreateInMemoryProject(projectContent);
Utilities_Tests.cs (3)
78TransientTestFile inputFile = env.CreateFile("tempInput.tmp", ObjectModelHelpers.CleanupFileContents(@" 152ObjectModelHelpers.CreateInMemoryProject(@" 169ObjectModelHelpers.CreateInMemoryProject(@"
WarningsAsMessagesAndErrors_Tests.cs (11)
31MockLogger logger = ObjectModelHelpers.BuildProjectExpectFailure(GetTestProject(treatAllWarningsAsErrors: true)); 35ObjectModelHelpers.BuildProjectExpectSuccess(GetTestProject(treatAllWarningsAsErrors: false)); 75MockLogger logger = ObjectModelHelpers.BuildProjectExpectFailure(GetTestProject(warningsAsErrors: ExpectedEventCode)); 83MockLogger logger = ObjectModelHelpers.BuildProjectExpectFailure( 97MockLogger logger = ObjectModelHelpers.BuildProjectExpectFailure( 113MockLogger logger = ObjectModelHelpers.BuildProjectExpectSuccess( 127MockLogger logger = ObjectModelHelpers.BuildProjectExpectSuccess(GetTestProject(warningsAsMessages: ExpectedEventCode)); 169MockLogger logger = ObjectModelHelpers.BuildProjectExpectSuccess( 183MockLogger logger = ObjectModelHelpers.BuildProjectExpectSuccess( 199MockLogger logger = ObjectModelHelpers.BuildProjectExpectSuccess( 213MockLogger logger = ObjectModelHelpers.BuildProjectExpectSuccess(
Microsoft.Build.Tasks.UnitTests (215)
AddToWin32Manifest_Tests.cs (1)
112Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory(projectFile, touchProject: false);
CallTarget_Tests.cs (8)
35MockLogger logger = ObjectModelHelpers.BuildProjectExpectSuccess(@" 56MockLogger logger = ObjectModelHelpers.BuildProjectExpectFailure(@" 88MockLogger logger = ObjectModelHelpers.BuildProjectExpectFailure(@" 115MockLogger logger = ObjectModelHelpers.BuildProjectExpectFailure(@" 136ObjectModelHelpers.BuildProjectExpectSuccess(@" 152Project project = ObjectModelHelpers.CreateInMemoryProject(@" 190ObjectModelHelpers.AssertItemsMatch(@" 201MockLogger logger = ObjectModelHelpers.BuildProjectExpectSuccess(@"
CombinePath_Tests.cs (9)
36ObjectModelHelpers.AssertItemsMatch(string.Format("{0}\r\n{1}", fullPath1, fullPath2), t.CombinedPaths, true); 66ObjectModelHelpers.AssertItemsMatch(pathsToMatch, t.CombinedPaths, true); 86ObjectModelHelpers.AssertItemsMatch(string.Format("{0}\r\n{1}", path1, fullPath2), t.CombinedPaths, true); 115ObjectModelHelpers.AssertItemsMatch(pathsToMatch, t.CombinedPaths, true); 147ObjectModelHelpers.AssertItemsMatch(expected, t.CombinedPaths, true); 163ObjectModelHelpers.AssertItemsMatch(@" 182ObjectModelHelpers.AssertItemsMatch(@" 199ObjectModelHelpers.AssertItemsMatch(@" 218ObjectModelHelpers.AssertItemsMatch(@"
ConvertToAbsolutePath_Tests.cs (9)
25string fileName = ObjectModelHelpers.CreateFileInTempProjectDirectory("file.temp", "foo"); 34Directory.SetCurrentDirectory(ObjectModelHelpers.TempProjectDir); 46ObjectModelHelpers.DeleteTempProjectDirectory(); 57string fileName = ObjectModelHelpers.CreateFileInTempProjectDirectory("file%3A.temp", "foo"); 66Directory.SetCurrentDirectory(ObjectModelHelpers.TempProjectDir); 78ObjectModelHelpers.DeleteTempProjectDirectory(); 87string fileName = ObjectModelHelpers.CreateFileInTempProjectDirectory("file.temp", "foo"); 96Directory.SetCurrentDirectory(ObjectModelHelpers.TempProjectDir); 108ObjectModelHelpers.DeleteTempProjectDirectory();
CreateItem_Tests.cs (10)
163ObjectModelHelpers.DeleteTempProjectDirectory(); 165ObjectModelHelpers.CreateFileInTempProjectDirectory("Myapp.proj", @" 176ObjectModelHelpers.CreateFileInTempProjectDirectory("Foo.txt", "foo"); 177ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine("Subdir", "Bar.txt"), "bar"); 180ObjectModelHelpers.BuildTempProjectFileExpectSuccess("Myapp.proj", logger); 182ObjectModelHelpers.AssertFileExistsInTempProjectDirectory(Path.Combine("Destination", "Foo.txt")); 183ObjectModelHelpers.AssertFileExistsInTempProjectDirectory(Path.Combine("Destination", "Subdir", "Bar.txt")); 195ObjectModelHelpers.DeleteTempProjectDirectory(); 197string projectFileFullPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("Myapp.proj", @" 207ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine("Subdir", "Bar.txt"), "bar");
CreateProperty_Tests.cs (3)
30MockLogger logger = ObjectModelHelpers.BuildProjectExpectSuccess(@" 57MockLogger logger = ObjectModelHelpers.BuildProjectExpectSuccess(@" 85MockLogger logger = ObjectModelHelpers.BuildProjectExpectSuccess(@"
DirectoryBuildProjectImportTestBase.cs (15)
29ObjectModelHelpers.DeleteTempProjectDirectory(); 64ObjectModelHelpers.DeleteTempProjectDirectory(); 77Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory(ObjectModelHelpers.CreateFileInTempProjectDirectory(_projectRelativePath, @" 100ObjectModelHelpers.CreateFileInTempProjectDirectory(DirectoryBuildProjectFile, BasicDirectoryBuildProjectContents); 106Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory(ObjectModelHelpers.CreateFileInTempProjectDirectory(_projectRelativePath, $@" 131string customFilePath = ObjectModelHelpers.CreateFileInTempProjectDirectory(CustomBuildProjectFile, BasicDirectoryBuildProjectContents); 137Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory(ObjectModelHelpers.CreateFileInTempProjectDirectory(_projectRelativePath, $@" 159ObjectModelHelpers.CreateFileInTempProjectDirectory(DirectoryBuildProjectFile, BasicDirectoryBuildProjectContents); 165Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory(ObjectModelHelpers.CreateFileInTempProjectDirectory(_projectRelativePath, @" 175Assert.Equal(ObjectModelHelpers.TempProjectDir, project.GetPropertyValue(DirectoryBuildProjectBasePathPropertyName), StringComparer.OrdinalIgnoreCase); 177Assert.Equal(Path.Combine(ObjectModelHelpers.TempProjectDir, DirectoryBuildProjectFile), project.GetPropertyValue(DirectoryBuildProjectPathPropertyName));
FindUnderPath_Tests.cs (3)
74string fileName = ObjectModelHelpers.CreateFileInTempProjectDirectory("file%3b.temp", "foo"); 77t.Path = new TaskItem(ObjectModelHelpers.TempProjectDir); 85Directory.SetCurrentDirectory(ObjectModelHelpers.TempProjectDir);
MSBuild_Tests.cs (75)
49string tempProject = ObjectModelHelpers.CreateTempFileOnDisk(@" 103string projectFile1 = ObjectModelHelpers.CreateTempFileOnDisk(@" 116string projectFile2 = ObjectModelHelpers.CreateTempFileOnDisk(@" 143ObjectModelHelpers.AssertItemsMatch(expectedItemOutputs, msbuildTask.TargetOutputs, false /* order of items not enforced */); 160string projectContents = ObjectModelHelpers.CleanupFileContents(@" 169Project project = ObjectModelHelpers.CreateInMemoryProject(projectContents, logger); 181ObjectModelHelpers.DeleteTempProjectDirectory(); 182ObjectModelHelpers.CreateFileInTempProjectDirectory( 192ObjectModelHelpers.BuildTempProjectFileExpectFailure(@"SkipNonexistentProjectsMain.csproj", logger); 202ObjectModelHelpers.DeleteTempProjectDirectory(); 203ObjectModelHelpers.CreateFileInTempProjectDirectory( 213ObjectModelHelpers.BuildTempProjectFileExpectFailure(@"SkipNonexistentProjectsMain.csproj", logger); 225ObjectModelHelpers.DeleteTempProjectDirectory(); 226ObjectModelHelpers.CreateFileInTempProjectDirectory( 235ObjectModelHelpers.CreateFileInTempProjectDirectory( 245ObjectModelHelpers.BuildTempProjectFileExpectSuccess(@"SkipNonexistentProjectsMain.csproj", logger); 261ObjectModelHelpers.DeleteTempProjectDirectory(); 262ObjectModelHelpers.CreateFileInTempProjectDirectory( 271ObjectModelHelpers.CreateFileInTempProjectDirectory( 281ObjectModelHelpers.BuildTempProjectFileExpectSuccess(@"SkipNonexistentProjectsMain.csproj", logger); 296ObjectModelHelpers.DeleteTempProjectDirectory(); 297ObjectModelHelpers.CreateFileInTempProjectDirectory( 316ObjectModelHelpers.CreateFileInTempProjectDirectory( 326ObjectModelHelpers.BuildTempProjectFileExpectFailure(@"SkipNonexistentProjectsMain.csproj", logger); 342ObjectModelHelpers.DeleteTempProjectDirectory(); 343ObjectModelHelpers.CreateFileInTempProjectDirectory( 352ObjectModelHelpers.CreateFileInTempProjectDirectory( 361ObjectModelHelpers.CreateFileInTempProjectDirectory( 372ObjectModelHelpers.BuildTempProjectFileExpectFailure(@"BuildingVCProjMain.csproj", logger); 393ObjectModelHelpers.DeleteTempProjectDirectory(); 400ObjectModelHelpers.CreateFileInTempProjectDirectory( 440ObjectModelHelpers.CreateFileInTempProjectDirectory( 463ObjectModelHelpers.CreateFileInTempProjectDirectory( 482ObjectModelHelpers.BuildTempProjectFileExpectSuccess(Path.Combine("bug'533'369", "Sub;Dir", "TeamBuild.proj"), logger); 484ObjectModelHelpers.AssertFileExistsInTempProjectDirectory(Path.Combine("bug'533'369", "Sub;Dir", "binaries", "ConsoleApplication1.exe")); 493string projectFile1 = ObjectModelHelpers.CreateTempFileOnDisk(@" 502string projectFile2 = ObjectModelHelpers.CreateTempFileOnDisk(@" 536ObjectModelHelpers.AssertItemsMatch(expectedItemOutputs, msbuildTask.TargetOutputs, false /* order of items not enforced */); 551string projectFile1 = ObjectModelHelpers.CreateTempFileOnDisk(@" 560string projectFile2 = ObjectModelHelpers.CreateTempFileOnDisk(@" 592ObjectModelHelpers.AssertItemsMatch(expectedItemOutputs, msbuildTask.TargetOutputs, false /* order of items not enforced */); 607string projectFile1 = ObjectModelHelpers.CreateTempFileOnDisk(@" 616string projectFile2 = ObjectModelHelpers.CreateTempFileOnDisk(@" 647ObjectModelHelpers.AssertItemsMatch(expectedItemOutputs, msbuildTask.TargetOutputs, false /* order of items not enforced */); 662string projectFile1 = ObjectModelHelpers.CreateTempFileOnDisk(@" 671string projectFile2 = ObjectModelHelpers.CreateTempFileOnDisk(@" 711string projectFile1 = ObjectModelHelpers.CreateTempFileOnDisk(@" 720string projectFile2 = ObjectModelHelpers.CreateTempFileOnDisk(@" 751ObjectModelHelpers.AssertItemsMatch(expectedItemOutputs, msbuildTask.TargetOutputs, false /* order of items not enforced */); 766string projectFile1 = ObjectModelHelpers.CreateTempFileOnDisk(@" 775string projectFile2 = ObjectModelHelpers.CreateTempFileOnDisk(@" 809ObjectModelHelpers.AssertItemsMatch(expectedItemOutputs, msbuildTask.TargetOutputs, false /* order of items not enforced */); 824string projectFile1 = ObjectModelHelpers.CreateTempFileOnDisk(@" 833string projectFile2 = ObjectModelHelpers.CreateTempFileOnDisk(@" 863ObjectModelHelpers.AssertItemsMatch(expectedItemOutputs, msbuildTask.TargetOutputs, false /* order of items not enforced */); 878string projectFile1 = ObjectModelHelpers.CreateTempFileOnDisk(@" 886string projectFile2 = ObjectModelHelpers.CreateTempFileOnDisk(@" 932string project1 = ObjectModelHelpers.CreateTempFileOnDisk(@" 940string project2 = ObjectModelHelpers.CreateTempFileOnDisk(@" 1135string project1 = ObjectModelHelpers.CreateTempFileOnDisk(@" 1143string project2 = ObjectModelHelpers.CreateTempFileOnDisk(@" 1200string project1 = ObjectModelHelpers.CreateTempFileOnDisk(@" 1304string projectFile1 = ObjectModelHelpers.CreateTempFileOnDisk(@" 1310string projectFile2 = ObjectModelHelpers.CreateTempFileOnDisk(@" 1368string projectFile1 = ObjectModelHelpers.CreateTempFileOnDisk(@" 1374string projectFile2 = ObjectModelHelpers.CreateTempFileOnDisk(@" 1404ObjectModelHelpers.DeleteTempProjectDirectory(); 1405ObjectModelHelpers.CreateFileInTempProjectDirectory( 1416ObjectModelHelpers.BuildTempProjectFileExpectSuccess(@"SkipNonexistentTargets.csproj", logger); 1430ObjectModelHelpers.DeleteTempProjectDirectory(); 1431ObjectModelHelpers.CreateFileInTempProjectDirectory( 1442ObjectModelHelpers.BuildTempProjectFileExpectFailure(@"SkipNonexistentTargets.csproj", logger); 1457string projectFile1 = ObjectModelHelpers.CreateTempFileOnDisk(@" 1464string projectFile2 = ObjectModelHelpers.CreateTempFileOnDisk(@" 1496string projectFile1 = ObjectModelHelpers.CreateTempFileOnDisk($@"
MSBuildInternalMessage_Tests.cs (5)
46Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory(projectFile, touchProject: false); 89Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory(projectFile, touchProject: false); 144Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory(projectFile, touchProject: false); 219Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory(projectFile, touchProject: false); 264Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory(projectFile, touchProject: false);
NuGetPropsImportTests.cs (6)
30ObjectModelHelpers.DeleteTempProjectDirectory(); 40var nugetPropsRelativePath = ObjectModelHelpers.CreateFileInTempProjectDirectory(NuGetPropsProjectFile, NuGetPropsContent); 45ObjectModelHelpers.CreateFileInTempProjectDirectory(projectRelativePath, $@" 54Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory(projectRelativePath); 71ObjectModelHelpers.CreateFileInTempProjectDirectory(projectRelativePath, $@" 80Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory(projectRelativePath);
OutputPathTests.cs (10)
29ObjectModelHelpers.DeleteTempProjectDirectory(); 34ObjectModelHelpers.DeleteTempProjectDirectory(); 46var projectFilePath = ObjectModelHelpers.CreateFileInTempProjectDirectory(_projectRelativePath, 62Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory(projectFilePath, touchProject: false); 81var projectFilePath = ObjectModelHelpers.CreateFileInTempProjectDirectory(_projectRelativePath, 98Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory(projectFilePath, touchProject: false); 119var projectFilePath = ObjectModelHelpers.CreateFileInTempProjectDirectory(_projectRelativePath, 141Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory(projectFilePath, touchProject: false); 162var projectFilePath = ObjectModelHelpers.CreateFileInTempProjectDirectory(_projectRelativePath, 177Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory(projectFilePath, touchProject: false);
ProjectExtensionsImportTestBase.cs (24)
22ObjectModelHelpers.DeleteTempProjectDirectory(); 43ObjectModelHelpers.DeleteTempProjectDirectory(); 56Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory(ObjectModelHelpers.CreateFileInTempProjectDirectory(_projectRelativePath, @" 75ObjectModelHelpers.CreateFileInTempProjectDirectory(ImportProjectPath, BasicProjectImportContents); 77Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory(ObjectModelHelpers.CreateFileInTempProjectDirectory(_projectRelativePath, $@" 100ObjectModelHelpers.CreateFileInTempProjectDirectory(ImportProjectPath, BasicProjectImportContents); 102Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory(ObjectModelHelpers.CreateFileInTempProjectDirectory(_projectRelativePath, $@" 132ObjectModelHelpers.CreateFileInTempProjectDirectory(ImportProjectPath, BasicProjectImportContents); 138Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory(ObjectModelHelpers.CreateFileInTempProjectDirectory(_projectRelativePath, $@" 150string projectExtensionsDirectory = Path.Combine(ObjectModelHelpers.TempProjectDir, Path.GetDirectoryName(ImportProjectPath)); 164ObjectModelHelpers.CreateFileInTempProjectDirectory(CustomImportProjectPath, BasicProjectImportContents); 170Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory(ObjectModelHelpers.CreateFileInTempProjectDirectory(_projectRelativePath, $@" 191ObjectModelHelpers.CreateFileInTempProjectDirectory(ImportProjectPath, BasicProjectImportContents); 197Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory(ObjectModelHelpers.CreateFileInTempProjectDirectory(_projectRelativePath, @" 215Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory(ObjectModelHelpers.CreateFileInTempProjectDirectory(_projectRelativePath, @" 241Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory(ObjectModelHelpers.CreateFileInTempProjectDirectory(_projectRelativePath, @"
ProjectExtensionsPropsImportTest.cs (1)
15protected override string CustomImportProjectPath => Path.Combine(ObjectModelHelpers.TempProjectDir, "obj", $"{Path.GetFileName(_projectRelativePath)}.custom.props");
ProjectExtensionsTargetsImportTest.cs (1)
15protected override string CustomImportProjectPath => Path.Combine(ObjectModelHelpers.TempProjectDir, "obj", $"{Path.GetFileName(_projectRelativePath)}.custom.targets");
RegressionTests.cs (6)
33Project project = ObjectModelHelpers.CreateInMemoryProject($@" 60var project = ObjectModelHelpers.CreateInMemoryProject($@" 90ObjectModelHelpers.DeleteTempProjectDirectory(); 92ObjectModelHelpers.CreateFileInTempProjectDirectory("Myapp.proj", @" 103ObjectModelHelpers.CreateFileInTempProjectDirectory("Foo.txt", "foo"); 105ObjectModelHelpers.BuildTempProjectFileExpectSuccess("Myapp.proj", logger);
ResolveSDKReference_Tests.cs (5)
3742string tempProjectContents = ObjectModelHelpers.CleanupFileContents( 3885string tempProjectContents = ObjectModelHelpers.CleanupFileContents( 4010string tempProjectContents = ObjectModelHelpers.CleanupFileContents( 4117string tempProjectContents = ObjectModelHelpers.CleanupFileContents( 4257string tempProjectContents = ObjectModelHelpers.CleanupFileContents(@"
ResourceHandling\GenerateResource_Tests.cs (16)
3079ObjectModelHelpers.DeleteTempProjectDirectory(); 3081ObjectModelHelpers.CreateFileInTempProjectDirectory("lib1.csproj", $@" 3111ObjectModelHelpers.CreateFileInTempProjectDirectory("Class1.cs", @" 3118ObjectModelHelpers.BuildTempProjectFileExpectSuccess("lib1.csproj", logger); 3120string p2pReference = Path.Combine(ObjectModelHelpers.TempProjectDir, "bin", "debug", "lib1.dll"); 3128ObjectModelHelpers.CreateFileInTempProjectDirectory(@"MyStrings.resx", @" 3213t.Sources = new ITaskItem[] { new TaskItem(Path.Combine(ObjectModelHelpers.TempProjectDir, "MyStrings.resx")) }; 3230ObjectModelHelpers.AssertFileExistsInTempProjectDirectory("MyStrings.resources"); 3255ObjectModelHelpers.DeleteTempProjectDirectory(); 3257ObjectModelHelpers.CreateFileInTempProjectDirectory("ClassLibrary20.csproj", $@" 3287ObjectModelHelpers.CreateFileInTempProjectDirectory("Class1.cs", @" 3303ObjectModelHelpers.BuildTempProjectFileExpectSuccess("ClassLibrary20.csproj", logger); 3310ObjectModelHelpers.CreateFileInTempProjectDirectory(@"MyStrings.resx", @" 3362t.Sources = new ITaskItem[] { new TaskItem(Path.Combine(ObjectModelHelpers.TempProjectDir, "MyStrings.resx")) }; 3374Directory.SetCurrentDirectory(ObjectModelHelpers.TempProjectDir); 3381ObjectModelHelpers.AssertFileExistsInTempProjectDirectory("MyStrings.resources");
SGen_Tests.cs (1)
24MockLogger logger = ObjectModelHelpers.BuildProjectExpectFailure(@$"
XmlPeek_Tests.cs (2)
327MockLogger logger = ObjectModelHelpers.BuildProjectExpectSuccess(projectContents); 337Project project = ObjectModelHelpers.CreateInMemoryProject(@"<Project><Target Name=""Test""><XmlPeek /></Target></Project>", log);
XmlPoke_Tests.cs (5)
145Project project = ObjectModelHelpers.CreateInMemoryProject(@"<Project><Target Name=""Test""><XmlPoke /></Target></Project>", log); 157Project project = ObjectModelHelpers.CreateInMemoryProject(projectContent, log); 170Project project = ObjectModelHelpers.CreateInMemoryProject(projectContent, log); 208ObjectModelHelpers.BuildProjectExpectSuccess(projectContents); 325MockLogger logger = ObjectModelHelpers.BuildProjectExpectSuccess(projectContents);
Microsoft.Build.UnitTests.Shared (8)
EngineTestEnvironment.cs (1)
131File.WriteAllText(ProjectFile, ObjectModelHelpers.CleanupFileContents(projectContents));
ObjectModelHelpers.cs (7)
1359content = ObjectModelHelpers.CleanupFileContents(content); 1374content = ObjectModelHelpers.CleanupFileContents(content); 1400content = ObjectModelHelpers.CleanupFileContents(content); 1460content = ObjectModelHelpers.CleanupFileContents(content); 1569ObjectModelHelpers.NormalizeXmlWhitespace( 1570ObjectModelHelpers.CleanupFileContents(newExpectedProjectContents)); 1622File.WriteAllText(createdProjectFile, ObjectModelHelpers.CleanupFileContents(projectContents));
Microsoft.Build.Utilities.UnitTests (18)
MuxLogger_Tests.cs (9)
45string projectBody = ObjectModelHelpers.CleanupFileContents(@" 81string projectBody = ObjectModelHelpers.CleanupFileContents(@" 96using ProjectFromString projectFromString = new(projectBody, null, ObjectModelHelpers.MSBuildDefaultToolsVersion, projectCollection); 106using ProjectFromString projectFromString1 = new(projectBody, null, ObjectModelHelpers.MSBuildDefaultToolsVersion, collection); 140string projectBody = ObjectModelHelpers.CleanupFileContents(@" 182string projectBody1 = ObjectModelHelpers.CleanupFileContents(@" 191string projectBody2 = ObjectModelHelpers.CleanupFileContents(@" 249string projectBody = ObjectModelHelpers.CleanupFileContents(@" 299string projectBody = ObjectModelHelpers.CleanupFileContents(@"
PlatformManifest_Tests.cs (1)
326File.WriteAllText(Path.Combine(_manifestDirectory, "Platform.xml"), ObjectModelHelpers.CleanupFileContents(contents));
ToolLocationHelper_Tests.cs (8)
692string tv12path = Path.Combine(ProjectCollection.GlobalProjectCollection.GetToolset(ObjectModelHelpers.MSBuildDefaultToolsVersion).ToolsPath, MSBuildExeName); 694tv12path.ShouldBe(ToolLocationHelper.GetPathToBuildToolsFile(MSBuildExeName, ObjectModelHelpers.MSBuildDefaultToolsVersion)); 714var toolsPath32 = ProjectCollection.GlobalProjectCollection.GetToolset(ObjectModelHelpers.MSBuildDefaultToolsVersion).Properties["MSBuildToolsPath32"]; 717tv12path.ShouldBe(ToolLocationHelper.GetPathToBuildToolsFile("msbuild.exe", ObjectModelHelpers.MSBuildDefaultToolsVersion, UtilitiesDotNetFrameworkArchitecture.Bitness32)); 3458$"CppUnitTestFramework, Version={ObjectModelHelpers.CurrentVisualStudioVersion}", manifestPath); 3463extensionSDK.Version.ShouldBe(new Version(ObjectModelHelpers.CurrentVisualStudioVersion)); 3552string tempProjectContents = ObjectModelHelpers.CleanupFileContents(@" 3621string tempProjectContents = ObjectModelHelpers.CleanupFileContents(@"