8 instantiations of TransientTestFile
Microsoft.Build.UnitTests.Shared (8)
TestEnvironment.cs (8)
213
return WithTransientTestState(new
TransientTestFile
(extension, createFile: true, expectedAsOutput: false));
223
return WithTransientTestState(new
TransientTestFile
(transientTestFolder.Path, fileName, contents));
234
return WithTransientTestState(new
TransientTestFile
(transientTestFolder.Path, extension,
246
return WithTransientTestState(new
TransientTestFile
(extension, createFile: false, expectedAsOutput: false));
257
return WithTransientTestState(new
TransientTestFile
(transientTestFolder.Path, extension,
268
return WithTransientTestState(new
TransientTestFile
(extension, createFile: false, expectedAsOutput: true));
279
return WithTransientTestState(new
TransientTestFile
(folderPath, extension, createFile: false, expectedAsOutput: true));
745
return new
TransientTestFile
(Path, fileName, contents);
284 references to TransientTestFile
Microsoft.Build.BuildCheck.UnitTests (28)
ConfigurationProvider_Tests.cs (7)
24
TransientTestFile
config1 = testEnvironment.CreateFile(workFolder1, ".editorconfig",
45
TransientTestFile
config1 = testEnvironment.CreateFile(workFolder1, ".editorconfig",
72
TransientTestFile
config1 = testEnvironment.CreateFile(workFolder1, ".editorconfig",
105
TransientTestFile
config1 = testEnvironment.CreateFile(workFolder1, ".editorconfig",
130
TransientTestFile
config1 = testEnvironment.CreateFile(workFolder1, ".editorconfig",
161
TransientTestFile
config1 = testEnvironment.CreateFile(workFolder1, ".editorconfig",
193
TransientTestFile
config1 = testEnvironment.CreateFile(workFolder1, ".editorconfig",
EditorConfigParser_Tests.cs (4)
68
TransientTestFile
config1 = testEnvironment.CreateFile(workFolder2, ".editorconfig",
77
TransientTestFile
config2 = testEnvironment.CreateFile(workFolder1, ".editorconfig",
100
TransientTestFile
config1 = testEnvironment.CreateFile(workFolder2, ".editorconfig",
106
TransientTestFile
config2 = testEnvironment.CreateFile(workFolder1, ".editorconfig",
EndToEndTests.cs (17)
49
out
TransientTestFile
projectFile,
329
out
TransientTestFile
projectFile,
411
out
TransientTestFile
projectFile,
412
out
TransientTestFile
editorconfigFile,
470
PrepareSampleProjectsAndConfig(buildInOutOfProcessNode, out
TransientTestFile
projectFile, new List<(string, string)>() { ("BC0101", "warning") });
506
PrepareSampleProjectsAndConfig(buildInOutOfProcessNode, out
TransientTestFile
projectFile, new List<(string, string)>() { ("BC0101", BC0101Severity) });
560
PrepareSampleProjectsAndConfig(true, out
TransientTestFile
projectFile, new List<(string, string)>() { ("BC0101", BC0101Severity) });
620
PrepareSampleProjectsAndConfig(buildInOutOfProcessNode, out
TransientTestFile
projectFile, new List<(string, string)>() { ("BC0101", "warning") });
672
out
TransientTestFile
projectFile,
708
out
TransientTestFile
projectFile,
733
out
TransientTestFile
projectFile,
857
PrepareSampleProjectsAndConfig(buildInOutOfProcessNode, out
TransientTestFile
projectFile, new List<(string, string)>() { ("BC0101", "warning") });
939
out
TransientTestFile
projectFile,
940
out
TransientTestFile
editorconfigFile,
948
TransientTestFile
testFile = _env.CreateFile(workFolder, "somefile");
956
TransientTestFile
supplementalFile = _env.CreateFile(workFolder, supplementalAssetName, supplementalContent);
981
out
TransientTestFile
projectFile,
Microsoft.Build.CommandLine.UnitTests (26)
MSBuildServer_Tests.cs (11)
95
TransientTestFile
project = _env.CreateFile("testProject.proj", printPidContents);
111
TransientTestFile
markerFile = _env.ExpectFile();
125
TransientTestFile
sleepProject = _env.CreateFile("napProject.proj", string.Format(sleepingTaskContentsFormat, markerFile.Path));
144
TransientTestFile
project = _env.CreateFile("testProject.proj", printPidContents);
181
TransientTestFile
project = _env.CreateFile("testProject.proj", printPidContents);
183
TransientTestFile
markerFile = _env.ExpectFile();
184
TransientTestFile
sleepProject = _env.CreateFile("napProject.proj", string.Format(sleepingTaskContentsFormat, markerFile.Path));
241
TransientTestFile
project = _env.CreateFile("testProject.proj", printPidContents);
278
TransientTestFile
project = _env.CreateFile("testProject.proj", printPidContents);
291
TransientTestFile
project = _env.CreateFile("testProject.proj", printPidContents);
321
TransientTestFile
project = _env.CreateFile("testProject.proj", reportMSBuildStartupDirectoryProperty);
PerfLog_Tests.cs (2)
34
TransientTestFile
classLibrary = testEnv.CreateFile(projectFolder, "ClassLibrary.csproj",
70
TransientTestFile
classLibrary = testEnv.CreateFile(projectFolder, "ClassLibrary.csproj",
TerminalLogger_Tests.cs (1)
727
TransientTestFile
projectFile = env.CreateFile(logFolder, "myProj.proj", contents);
XMake_Tests.cs (12)
712
TransientTestFile
project = env.CreateFile("testProject.csproj", "Project");
748
TransientTestFile
project = env.CreateFile("testProject.csproj", @"
802
TransientTestFile
project = env.CreateFile("testProject.csproj", @"
821
TransientTestFile
project = env.CreateFile("testProject.csproj", @"
851
TransientTestFile
project = env.CreateFile("testProject.csproj", @"
862
TransientTestFile
wrongSyntaxFile = env.CreateFile("Program.cs", @"
1283
TransientTestFile
autoRspFile = env.CreateFile(folder, AutoResponseFileName, "-nowarn:MSB1001 @myRsp.rsp %NONEXISTENTENVIRONMENTVARIABLE%");
1284
TransientTestFile
projectFile = env.CreateFile(folder, "project.proj", "<Project><Target Name=\"T\"><Message Text=\"Text\"/></Target></Project>");
1285
TransientTestFile
rpsFile = env.CreateFile(folder, "myRsp.rsp", "-nr:false -m:2");
2482
var
projectFile = tempDir.CreateFile("missingloggertest.proj", projectString);
2517
var
testProject = _env.CreateFile("Importer.proj", ObjectModelHelpers.CleanupFileContents(@"
2597
var
testSolution = _env.CreateFile("TestSolution.sln", ObjectModelHelpers.CleanupFileContents(solutionFileContents));
Microsoft.Build.Engine.OM.UnitTests (6)
Construction\ProjectTargetElement_Tests.cs (1)
356
TransientTestFile
file = env.CreateFile("proj.csproj", projectFile);
Construction\SolutionFile_Tests.cs (1)
689
TransientTestFile
sln = testEnvironment.CreateFile(FileUtilities.GetTemporaryFileName(".sln"), solutionFileContents);
Definition\Project_Tests.cs (2)
3977
var
importFile = env.CreateFile(".targets");
4024
var
importFile = env.CreateFile(".targets");
Definition\ProjectItem_Tests.cs (1)
452
TransientTestFile
file = env.CreateFile(directory, "a.cs", String.Empty);
NugetRestoreTests.cs (1)
30
TransientTestFile
sln = testEnvironment.CreateFile(folder, "test.sln",
Microsoft.Build.Engine.UnitTests (151)
BackEnd\GenerateTemporaryTargetAssembly_Tests.cs (1)
21
TransientTestFile
otherproj = testenv.CreateFile("otherproj.csproj", @"
BackEnd\MSBuild_Tests.cs (3)
792
var
projectFile = env.CreateFile("test.proj", ObjectModelHelpers.CleanupFileContents(projectContent));
824
var
projectFile = env.CreateFile(projFileName, ObjectModelHelpers.CleanupFileContents(projectContent));
871
var
projectFile = env.CreateFile("test.proj", ObjectModelHelpers.CleanupFileContents(projectContent));
BackEnd\TaskBuilder_Tests.cs (1)
100
TransientTestFile
projectFile = env.CreateFile("myProj.proj", projectFileContents);
BackEnd\TaskHostFactory_Tests.cs (1)
44
TransientTestFile
project = env.CreateFile("testProject.csproj", pidTaskProject);
BinaryLogger_Tests.cs (5)
354
TransientTestFile
projectFile = env.CreateFile(logFolder, "myProj.proj", contents);
413
TransientTestFile
projectFile = env.CreateFile(logFolder, "myProj.proj", contents);
478
TransientTestFile
testFile = testFolder.CreateFile(testFileName, string.Join(Environment.NewLine, new[] { "123", "456" }));
625
TransientTestFile
projectFile1 = env.CreateFile(testFolder, "testProject01.proj", contents);
633
TransientTestFile
projectFile2 = env.CreateFile(testFolder, $"testProject_{verbosity}.proj", contents);
ChangeWaves_Tests.cs (1)
59
TransientTestFile
file = testEnvironment.CreateFile("proj.csproj", projectFile);
Construction\ProjectImportElement_Tests.cs (2)
22
TransientTestFile
projectFile = testEnvironment.CreateFile(
59
TransientTestFile
projectFile = testEnvironment.CreateFile(
Construction\SolutionFile_NewParser_Tests.cs (1)
138
TransientTestFile
sln = testEnvironment.CreateFile(FileUtilities.GetTemporaryFileName(".sln"), solutionFileContents);
Construction\SolutionFilter_Tests.cs (12)
56
TransientTestFile
classLibrary = testEnvironment.CreateFile(classLibSubFolder, "ClassLibrary.csproj",
66
TransientTestFile
simpleProject = testEnvironment.CreateFile(simpleProjectSubFolder, "SimpleProject.csproj",
74
TransientTestFile
solutionFile = testEnvironment.CreateFile(simpleProjectFolder, "SimpleProject.sln",
111
TransientTestFile
filterFile = testEnvironment.CreateFile(folder, "solutionFilter.slnf",
214
TransientTestFile
sln = testEnvironment.CreateFile(folder, "Dev.sln");
215
TransientTestFile
slnf = testEnvironment.CreateFile(folder, "Dev.slnf", slnfValue.Replace(@"C:\\notAPath\\MSBuild.Dev.sln", sln.Path.Replace("\\", "\\\\")));
233
TransientTestFile
microsoftBuild = testEnvironment.CreateFile(src, "Microsoft.Build.csproj");
234
TransientTestFile
msbuild = testEnvironment.CreateFile(src, "MSBuild.csproj");
235
TransientTestFile
commandLineUnitTests = testEnvironment.CreateFile(src, "Microsoft.Build.CommandLine.UnitTests.csproj");
236
TransientTestFile
tasksUnitTests = testEnvironment.CreateFile(src, "Microsoft.Build.Tasks.UnitTests.csproj");
238
TransientTestFile
sln = testEnvironment.CreateFile(folder, "Microsoft.Build.Dev.sln",
264
TransientTestFile
slnf = testEnvironment.CreateFile(folder, "Dev.slnf",
Construction\SolutionProjectGenerator_Tests.cs (15)
70
TransientTestFile
sln = testEnvironment.CreateFile(folder, "MySln.sln", "Microsoft Visual Studio Solution File, Format Version 12.00");
71
TransientTestFile
targetsFile = testEnvironment.CreateFile(folder, name,
93
TransientTestFile
classLibrary = testEnvironment.CreateFile(classLibFolder, "classlib.csproj",
103
TransientTestFile
simpleProject = testEnvironment.CreateFile(simpleProjectFolder, "simpleProject.csproj",
112
TransientTestFile
solutionFile = testEnvironment.CreateFile(folder, "testFolder.sln",
138
TransientTestFile
classLibrary = testEnvironment.CreateFile(classLibFolder, "classlib.csproj",
154
TransientTestFile
simpleProject = testEnvironment.CreateFile(simpleProjectFolder, "simpleProject.csproj",
169
TransientTestFile
solutionFile = testEnvironment.CreateFile(folder, "testFolder.sln",
214
TransientTestFile
classLibrary = testEnvironment.CreateFile(classLibFolder, "classlib.csproj",
230
TransientTestFile
simpleProject = testEnvironment.CreateFile(simpleProjectFolder, "simpleProject.csproj",
245
TransientTestFile
solutionFile = testEnvironment.CreateFile(folder, "testFolder.sln",
883
TransientTestFile
proj1 = env.CreateFile("A.csproj", @"<Project><Target Name=""Printer""><Message Importance=""high"" Text=""print string"" /></Target></Project>");
884
TransientTestFile
proj2 = env.CreateFile("B.csproj", @"<Project><Target Name=""Printer""><Message Importance=""high"" Text=""print string"" /></Target></Project>");
885
TransientTestFile
proj3 = env.CreateFile("C.csproj", @"<Project><Target Name=""Printer""><Message Importance=""high"" Text=""print string"" /></Target></Project>");
886
TransientTestFile
proj = env.CreateFile("mysln.sln",
Definition\ProjectEvaluationContext_Tests.cs (3)
852
var
subdirectoryFile = subdirectory.CreateFile("a");
908
var
subdirectoryFile = subdirectory.CreateFile("a");
909
var
rootFile = _env.DefaultTestDirectory.CreateFile("a");
Evaluation\Evaluator_Tests.cs (4)
57
TransientTestFile
projectFile = env.CreateFile("project.proj", $@"
77
TransientTestFile
realFile = env.CreateFile(existentDirectory, "realFile.csproj", @"<Project> </Project>");
78
TransientTestFile
projectFile = env.CreateFile("project.proj", @$"
5017
var
tempPath = env.CreateFile(Guid.NewGuid().ToString(), testTargets);
Evaluation\Expander_Tests.cs (12)
4783
var
projectFile = env.CreateFile(alpha, ".proj",
4827
var
projectFile = env.CreateFile(alpha, ".proj",
4861
var
projectFile = env.CreateFile(root, ".proj",
4901
var
projectFile = env.CreateFile(root, ".proj",
4915
var
one = alpha.CreateFile("One.cs");
4916
var
three = alpha.CreateFile("Three.cs");
4942
var
projectFile = env.CreateFile(root, ".proj",
4984
var
projectFile = env.CreateFile(root, ".proj",
5028
var
projectFile = env.CreateFile(root, ".proj",
5071
var
projectFile = env.CreateFile(root, ".proj",
5103
var
projectFile = env.CreateFile(root, ".proj",
5175
var
dummyAssemblyFile = env.CreateFile(env.CreateFolder(), "test.dll");
FileLogger_Tests.cs (1)
403
var
logFile = testEnvironment.CreateFile(".log");
FileMatcher_Tests.cs (1)
79
TransientTestFile
file = _env.CreateFile(testFolder, "Foo.cs");
Graph\GetCompatiblePlatformGraph_Tests.cs (27)
43
TransientTestFile
entryProject = CreateProjectFile(env, 1, extraContent: @"<PropertyGroup>
51
var
proj2 = env.CreateFile("2.proj", @"
70
TransientTestFile
entryProject = CreateProjectFile(env, 1, extraContent: @"<PropertyGroup>
80
var
proj2 = env.CreateFile("2.proj", @"
91
var
proj3 = env.CreateFile("3.proj", @"
111
TransientTestFile
entryProject = CreateProjectFile(env, 1, extraContent: @"<PropertyGroup>
121
var
proj2 = env.CreateFile("2.proj", @"
133
var
proj3 = env.CreateFile("3.proj", @"
153
TransientTestFile
entryProject = CreateProjectFile(env, 1, extraContent: @"<PropertyGroup>
162
var
proj2 = env.CreateFile("2.proj", @"
173
var
proj3 = env.CreateFile("3.proj", @"
194
TransientTestFile
entryProject = CreateProjectFile(env, 1, extraContent: @"<PropertyGroup>
203
var
proj2 = env.CreateFile("2.proj", @"
221
TransientTestFile
entryProject = CreateProjectFile(env, 1, extraContent: @"<PropertyGroup>
230
var
proj2 = env.CreateFile("2.proj", @"
249
TransientTestFile
entryProject = CreateProjectFile(env, 1, extraContent: @"<PropertyGroup>
258
var
proj2 = env.CreateFile("2.proj", @"
276
TransientTestFile
entryProject = CreateProjectFile(env, 1, extraContent: @"<PropertyGroup>
285
var
proj2 = env.CreateFile("2.proj", @"
304
TransientTestFile
entryProject = CreateProjectFile(env, 1, extraContent: @"<PropertyGroup>
313
var
proj2 = env.CreateFile("2.proj", @"
334
TransientTestFile
entryProject = CreateProjectFile(env, 1, extraContent: @"<PropertyGroup>
342
var
proj2 = env.CreateFile("2.proj", @"
367
TransientTestFile
project1 = testEnvironment.CreateFile(project1SubFolder, $"{firstProjectName}.csproj",
382
TransientTestFile
project2 = testEnvironment.CreateFile(project2SubFolder, $"{secondProjectName}.proj",
393
TransientTestFile
project3 = testEnvironment.CreateFile(project3SubFolder, $"{thirdProjectName}.proj",
404
TransientTestFile
solutionFile = testEnvironment.CreateFile(folder, "SimpleProject.sln",
Graph\GraphLoadedFromSolution_tests.cs (1)
75
var
root = GraphTestingUtilities.CreateProjectFile(
Graph\GraphTestingUtilities.cs (1)
196
internal static
TransientTestFile
CreateProjectFile(
Graph\IsolateProjects_Tests.cs (1)
559
TransientTestFile
CreateTmpFile(TestEnvironment env)
Graph\ProjectGraph_Tests.cs (50)
64
TransientTestFile
entryProject = CreateProjectFile(env, 1);
91
TransientTestFile
entryProject = CreateProjectFile(env, 1, new[] { 2 });
102
TransientTestFile
entryProject = CreateProjectFile(env, 1);
205
TransientTestFile
entryProject = CreateProjectFile(env, 1);
227
TransientTestFile
entryProject = CreateProjectFile(env, 1, new[] { 2, 3 });
252
TransientTestFile
entryProject = CreateProjectFile(env, 2, new[] { 3, 5, 6 });
305
TransientTestFile
entryProject = CreateProjectFile(env, 1, new[] { 2 });
306
var
proj2 = CreateProjectFile(env, 2, new[] { 3 });
307
var
proj3 = CreateProjectFile(env, 3, new[] { 1 });
319
TransientTestFile
entryProject = CreateProjectFile(env, 1, new[] { 2, 3 });
332
TransientTestFile
entryProject = CreateProjectFile(env, 1, new[] { 2, 3, 4 });
333
var
proj2 = CreateProjectFile(env, 2, new[] { 5, 6 });
334
var
proj3 = CreateProjectFile(env, 3, new[] { 2, 8 });
337
var
proj6 = CreateProjectFile(env, 6, new[] { 7 });
338
var
proj7 = CreateProjectFile(env, 7, new[] { 3 });
351
var
entryFile1 = CreateProjectFile(_env, 1, new[] { 3, 4 });
352
var
entryFile2 = CreateProjectFile(_env, 2, new[] { 4, 5 });
389
TransientTestFile
entryProject = CreateProjectFile(env, 1, new[] { 2, 3 });
422
TransientTestFile
entryProject = env.CreateFile("1.proj", @"
441
TransientTestFile
entryProject = CreateProjectFile(env, 1, new[] { 2, 3 });
481
TransientTestFile
entryProject = CreateProjectFile(env, 1, new[] { 2, 3 });
512
TransientTestFile
entryProject = CreateProjectFile(env, 1, new[] { 2, 3, 4 });
554
TransientTestFile
entryProject = CreateProjectFile(env, 1, new[] { 2 });
575
TransientTestFile
entryProject1 = CreateProjectFile(env, 1, new[] { 3 });
576
TransientTestFile
entryProject2 = CreateProjectFile(env, 2, new[] { 3 });
596
TransientTestFile
entryProject = CreateProjectFile(env, 1, new[] { 2 });
630
TransientTestFile
entryProject = env.CreateFile("1.proj", @"
667
TransientTestFile
entryProject1 = CreateProjectFile(env, 1, new[] { 4 });
668
TransientTestFile
entryProject2 = CreateProjectFile(env, 2, new[] { 4, 5 });
669
TransientTestFile
entryProject3 = CreateProjectFile(env, 3, new[] { 2, 6 });
817
TransientTestFile
slnFile = env.CreateFile(@"Solution.sln", SolutionFileContents);
919
TransientTestFile
entryProject = CreateProjectFile(env: env, projectNumber: 1, projectReferences: new[] { 2, 3 }, projectReferenceTargets: new Dictionary<string, string[]> { { "A", new[] { "B" } } });
948
TransientTestFile
entryProject = CreateProjectFile(env: env, projectNumber: 1, projectReferences: new[] { 2 }, projectReferenceTargets: projectReferenceTargets);
976
TransientTestFile
entryProject = CreateProjectFile(env: env, projectNumber: 1, projectReferences: new[] { 2, 3, 5 }, projectReferenceTargets: projectReferenceTargets);
1002
TransientTestFile
entryProject = CreateProjectFile(env: env, projectNumber: 1, projectReferences: new[] { 2 }, projectReferenceTargets: new Dictionary<string, string[]> { { "A", new[] { "B" } } }, defaultTargets: "A");
1020
TransientTestFile
entryProject = CreateProjectFile(env: env, projectNumber: 1, projectReferences: new[] { 2 }, projectReferenceTargets: new Dictionary<string, string[]> { { "A", new[] { "B" } } }, defaultTargets: "A");
1040
TransientTestFile
entryProject = CreateProjectFile(env: env, projectNumber: 1, projectReferences: new[] { 2 }, projectReferenceTargets: new Dictionary<string, string[]> { { "A", new[] { "B" } } }, defaultTargets: string.Empty);
1063
TransientTestFile
entryProject = CreateProjectFile(env: env, projectNumber: 1, projectReferences: new[] { 2 }, projectReferenceTargets: new Dictionary<string, string[]> { { "A", new[] { " ; ; " } } }, defaultTargets: string.Empty);
1084
TransientTestFile
entryProject = CreateProjectFile(env: env, projectNumber: 1);
1391
TransientTestFile
entryProject = CreateProjectFile(env, 1, new[] { 2 }, new Dictionary<string, string[]> { { "A", new[] { ".default" } } }, defaultTargets: "A");
1409
TransientTestFile
entryProject = CreateProjectFile(
1439
TransientTestFile
entryProject = CreateProjectFile(env, 1, new[] { 2, 3, 4 }, projectReferenceTargets);
1473
var
entryProject = CreateProjectFile(
1630
TransientTestFile
entryProject1 = CreateProjectFile(env, 1, projectReferences: new[] { 2 }, defaultTargets: "A", extraContent: ProjectReferenceTargetsWithMultitargeting);
1631
TransientTestFile
entryProject2 = CreateProjectFile(env, 2, defaultTargets: "A", extraContent: OuterBuildSpecificationWithProjectReferenceTargets);
2838
TransientTestFile
project1File = CreateProjectFile(env: env, projectNumber: 1, defaultTargets: "Project1Default", extraContent: ExtraContent);
2839
TransientTestFile
project2File = CreateProjectFile(env: env, projectNumber: 2, defaultTargets: "Project2Default", extraContent: ExtraContent);
2870
TransientTestFile
slnFile = env.CreateFile(@"Solution.sln", solutionFileContents);
2891
TransientTestFile
project1File = CreateProjectFile(env: env, projectNumber: 1);
2915
TransientTestFile
slnFile = env.CreateFile(@"Solution.sln", solutionFileContents);
Graph\ResultCacheBasedBuilds_Tests.cs (2)
512
private static
TransientTestFile
CreateProjectFileWrapper(TestEnvironment env, int projectNumber, int[] projectReferences, Dictionary<string, string[]> projectReferenceTargets, string defaultTargets, string extraContent)
517
internal static
TransientTestFile
CreateProjectFileWithBuildTargetAndItems(
ProjectCache\ProjectCacheTests.cs (3)
873
var
project1 = _env.CreateFile("1.proj", @"
1110
var
project = _env.CreateFile("1.proj", @$"
1327
var
project = _env.CreateFile(
TerminalLoggerConfiguration_Tests.cs (1)
32
TransientTestFile
projectFile = _env.CreateFile(logFolder, "myProj.proj", $"""
Utilities_Tests.cs (2)
78
TransientTestFile
inputFile = env.CreateFile("tempInput.tmp", ObjectModelHelpers.CleanupFileContents(@"
82
TransientTestFile
outputFile = env.CreateFile("tempOutput.tmp");
Microsoft.Build.Tasks.UnitTests (59)
AssemblyDependency\ResolveAssemblyReferenceCacheSerialization.cs (3)
124
TransientTestFile
file = env.CreateFile();
160
TransientTestFile
file = env.CreateFile();
186
TransientTestFile
file = env.CreateFile();
CodeTaskFactoryEmbeddedFileInBinlogTestHelper.cs (3)
32
var
sourceClass = env.CreateFile(folder, $"{taskName}.cs", sourceContent);
54
TransientTestFile
binlog = env.ExpectFile(".binlog");
106
TransientTestFile
binlog = env.ExpectFile(".binlog");
Copy_Tests.cs (11)
145
var
sourceFile = env.CreateFile("source.txt");
169
var
sourceFile = env.CreateFile("source.txt");
262
var
sourceFile = env.CreateFile("source.txt");
341
var
sourceFile = env.CreateFile("source.txt");
364
var
sourceFile = env.CreateFile("source.txt");
388
var
sourceFile = env.CreateFile("source.txt");
412
var
sourceFile = env.CreateFile("source.txt");
437
var
sourceFile = env.CreateFile("source.txt");
463
var
sourceFile = env.CreateFile("source.txt");
2942
TransientTestFile
sourceFile1 = env.CreateFile("source1.tmp", "This is the first source temp file."); // HIGHCHAR: Test writes in UTF8 without preamble.
2943
TransientTestFile
sourceFile2 = env.CreateFile("source2.tmp", "This is the second source temp file."); // HIGHCHAR: Test writes in UTF8 without preamble.
CreateCSharpManifestResourceName_Tests.cs (14)
386
var
csFile = env.CreateFile("SR1.cs", "namespace MyStuff.Namespace { class Class { } }");
387
var
resXFile = env.CreateFile("SR1.resx", "");
418
var
csFile = env.CreateFile("SR1.cs", "namespace MyStuff.Namespace { class Class { } }");
420
var
resourceFile = env.CreateFile(ResourceFileName, "");
457
var
csFile = subfolder.CreateFile("SR1.cs", "namespace MyStuff.Namespace { class Class { } }");
458
var
resXFile = subfolder.CreateFile("SR1.resx", "");
490
var
resXFile = env.CreateFile("SR1.resx", "");
523
var
conventionCSFile = env.CreateFile("SR1.cs", "namespace MyStuff.Namespace { class Class { } }");
524
var
nonConventionCSFile = env.CreateFile("SR2.cs", "namespace MyStuff2.Namespace { class Class2 { } }");
525
var
resXFile = env.CreateFile("SR1.resx", "");
554
var
csFile = env.CreateFile("SR1.cs", "namespace MyStuff.Namespace { class Class { } }");
555
var
resXFile = env.CreateFile("SR1.resx", "");
588
var
csFile = env.CreateFile("SR1.cs", "namespace MyStuff.Namespace { class Class { } }");
589
var
resXFile = env.CreateFile("SR1.de.resx", "");
HintPathResolver_Tests.cs (3)
34
var
tempFile = _env.CreateFile("FakeSystem.Net.Http.dll", "");
54
var
tempFile = _env.CreateFile("FakeSystem.Net.Http.dll", "");
63
var
tempFile = _env.CreateFile("FakeSystem.Net.Http.dll", "");
RARPrecomputedCache_Tests.cs (3)
25
TransientTestFile
standardCache = env.CreateFile(".cache");
60
TransientTestFile
standardCache = env.CreateFile(".cache");
111
TransientTestFile
precomputedCache = env.CreateFile(".cache");
ResourceHandling\GenerateResource_Tests.cs (2)
2001
TransientTestFile
resource = env.CreateFile(".resx", @"<?xml version=""1.0"" encoding=""utf-8""?>
3919
var
dll = folder.CreateFile("System.Resource.Extensions.dll");
ResourceHandling\MSBuildResXReader_Tests.cs (2)
161
var
linkedTextFile = resourceHandlingFolder.CreateFile("TextFileInShiftJIS.txt");
296
var
linkedTextFile = resourceHandlingFolder.CreateFile("FileToBeIncluded.txt");
RoslynCodeTaskFactory_Tests.cs (9)
52
TransientTestFile
inlineTask = env.CreateFile(folder, "5106.proj", @$"
92
TransientTestFile
assemblyProj = env.CreateFile(folder, "5106.csproj", @$"
105
TransientTestFile
csFile = env.CreateFile(folder, "Class1.cs", @"
119
TransientTestFile
inlineTask = env.CreateFile(folder, "5106.proj", @$"
294
TransientTestFile
file = testEnvironment.CreateFile(fileName: "236D48CE30064161B31B55DBF088C8B2", contents: "6159BD98607A460AA4F11D2FA92E5436");
391
TransientTestFile
file = env.CreateFile(fileName: "CSharpClassSourceCodeFromFile.tmp", contents: taskClassSourceCode);
408
TransientTestFile
file = testEnvironment.CreateFile(fileName: "CSharpFragmentSourceCodeFromFile.tmp", contents: sourceCodeFileContents);
424
TransientTestFile
file = testEnvironment.CreateFile(fileName: "CSharpMethodSourceCodeFromFile.tmp", contents: sourceCodeFileContents);
600
TransientTestFile
file = testEnvironment.CreateFile(fileName: "CB3096DA4A454768AA9C0C4D422FC188.tmp", contents: sourceCodeFileContents);
Unzip_Tests.cs (4)
31
TransientTestFile
file1 = testEnvironment.CreateFile(source, "638AF4AE88A146E09CB69FE1CA7083DC.txt", "file1");
184
TransientTestFile
file1 = testEnvironment.CreateFile(source, "D6DFD219DACE48F8B86EFCDF98433333.txt", "file1");
212
TransientTestFile
file = testEnvironment.CreateFile("foo.txt", "foo");
460
var
sourceFile = testEnvironment.CreateFile(source, executableName, "Dummy executable");
WriteCodeFragment_Tests.cs (1)
147
var
file = env.ExpectFile(Directory.GetCurrentDirectory(), ".tmp");
WriteLinesToFile_Tests.cs (2)
328
var
file = testEnv.CreateFile("FileToBeEmptied.txt", "Contents that should be erased");
355
var
file = testEnv.GetTempFile();
ZipDirectory_Tests.cs (2)
73
TransientTestFile
file = testEnvironment.CreateFile(testEnvironment.DefaultTestDirectory, "test.zip", contents: "test");
112
TransientTestFile
file = testEnvironment.CreateFile("foo.zip", "foo");
Microsoft.Build.UnitTests.Shared (13)
ObjectModelHelpers.cs (4)
1685
public delegate
TransientTestFile
CreateProjectFileDelegate(
1693
public static
TransientTestFile
CreateProjectFile(
1765
TransientTestFile
file = createProjectFile(
1788
TransientTestFile
file = createProjectFile(
TestEnvironment.cs (9)
211
public
TransientTestFile
CreateFile(string extension = ".tmp")
216
public
TransientTestFile
CreateFile(string fileName, string contents = "")
221
public
TransientTestFile
CreateFile(TransientTestFolder transientTestFolder, string fileName, string contents = "")
232
public
TransientTestFile
CreateFile(TransientTestFolder transientTestFolder, string extension = ".tmp")
244
public
TransientTestFile
GetTempFile(string extension = ".tmp")
255
public
TransientTestFile
GetTempFile(TransientTestFolder transientTestFolder, string extension = ".tmp")
266
public
TransientTestFile
ExpectFile(string extension = ".tmp")
277
public
TransientTestFile
ExpectFile(string folderPath, string extension = ".tmp")
743
public
TransientTestFile
CreateFile(string fileName, string contents = null)
Microsoft.Build.Utilities.UnitTests (1)
ToolTask_Tests.cs (1)
848
var
output = testEnvironment.ExpectFile();