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