125 references to CreateFile
Microsoft.Build.CommandLine.UnitTests (19)
MSBuildServer_Tests.cs (9)
95TransientTestFile project = _env.CreateFile("testProject.proj", printPidContents); 125TransientTestFile sleepProject = _env.CreateFile("napProject.proj", string.Format(sleepingTaskContentsFormat, markerFile.Path)); 144TransientTestFile project = _env.CreateFile("testProject.proj", printPidContents); 181TransientTestFile project = _env.CreateFile("testProject.proj", printPidContents); 184TransientTestFile sleepProject = _env.CreateFile("napProject.proj", string.Format(sleepingTaskContentsFormat, markerFile.Path)); 241TransientTestFile project = _env.CreateFile("testProject.proj", printPidContents); 278TransientTestFile project = _env.CreateFile("testProject.proj", printPidContents); 291TransientTestFile project = _env.CreateFile("testProject.proj", printPidContents); 321TransientTestFile project = _env.CreateFile("testProject.proj", reportMSBuildStartupDirectoryProperty);
XMake_Tests.cs (10)
712TransientTestFile project = env.CreateFile("testProject.csproj", "Project"); 748TransientTestFile project = env.CreateFile("testProject.csproj", @" 802TransientTestFile project = env.CreateFile("testProject.csproj", @" 821TransientTestFile project = env.CreateFile("testProject.csproj", @" 851TransientTestFile project = env.CreateFile("testProject.csproj", @" 862TransientTestFile wrongSyntaxFile = env.CreateFile("Program.cs", @" 2517var testProject = _env.CreateFile("Importer.proj", ObjectModelHelpers.CleanupFileContents(@" 2526_env.CreateFile("TestProject.proj", @" 2597var testSolution = _env.CreateFile("TestSolution.sln", ObjectModelHelpers.CleanupFileContents(solutionFileContents)); 2600_env.CreateFile("TestProject.proj", @$"
Microsoft.Build.Engine.OM.UnitTests (2)
Construction\ProjectTargetElement_Tests.cs (1)
356TransientTestFile file = env.CreateFile("proj.csproj", projectFile);
Construction\SolutionFile_Tests.cs (1)
689TransientTestFile sln = testEnvironment.CreateFile(FileUtilities.GetTemporaryFileName(".sln"), solutionFileContents);
Microsoft.Build.Engine.UnitTests (75)
BackEnd\BuildManager_Tests.cs (7)
990var result = buildManagerSession.BuildProjectFile(_env.CreateFile("build.proj", contents).Path); 2223_env.CreateFile(data.ProjectFullPath, data.ProjectInstance.ToProjectRootElement().RawXml); 4027var entryFile = env.CreateFile(nameof(a), a).Path; 4028env.CreateFile(nameof(b), b); 4029env.CreateFile(nameof(c), c); 4030env.CreateFile(nameof(delay), delay); 4031env.CreateFile(nameof(reentrant), reentrant);
BackEnd\GenerateTemporaryTargetAssembly_Tests.cs (1)
21TransientTestFile otherproj = testenv.CreateFile("otherproj.csproj", @"
BackEnd\MSBuild_Tests.cs (3)
792var projectFile = env.CreateFile("test.proj", ObjectModelHelpers.CleanupFileContents(projectContent)); 824var projectFile = env.CreateFile(projFileName, ObjectModelHelpers.CleanupFileContents(projectContent)); 871var projectFile = env.CreateFile("test.proj", ObjectModelHelpers.CleanupFileContents(projectContent));
BackEnd\TaskBuilder_Tests.cs (1)
100TransientTestFile projectFile = env.CreateFile("myProj.proj", projectFileContents);
BackEnd\TaskHostFactory_Tests.cs (1)
44TransientTestFile project = env.CreateFile("testProject.csproj", pidTaskProject);
ChangeWaves_Tests.cs (1)
59TransientTestFile file = testEnvironment.CreateFile("proj.csproj", projectFile);
Construction\ProjectImportElement_Tests.cs (2)
22TransientTestFile projectFile = testEnvironment.CreateFile( 59TransientTestFile projectFile = testEnvironment.CreateFile(
Construction\SolutionFile_NewParser_Tests.cs (1)
138TransientTestFile sln = testEnvironment.CreateFile(FileUtilities.GetTemporaryFileName(".sln"), solutionFileContents);
Construction\SolutionProjectGenerator_Tests.cs (4)
883TransientTestFile proj1 = env.CreateFile("A.csproj", @"<Project><Target Name=""Printer""><Message Importance=""high"" Text=""print string"" /></Target></Project>"); 884TransientTestFile proj2 = env.CreateFile("B.csproj", @"<Project><Target Name=""Printer""><Message Importance=""high"" Text=""print string"" /></Target></Project>"); 885TransientTestFile proj3 = env.CreateFile("C.csproj", @"<Project><Target Name=""Printer""><Message Importance=""high"" Text=""print string"" /></Target></Project>"); 886TransientTestFile proj = env.CreateFile("mysln.sln",
Definition\ProjectEvaluationContext_Tests.cs (3)
100_env.CreateFile("1.proj", @"<Project> <PropertyGroup Condition=`Exists('1.file')`></PropertyGroup> </Project>".Cleanup()).Path, 101_env.CreateFile("2.proj", @"<Project> <PropertyGroup Condition=`Exists('2.file')`></PropertyGroup> </Project>".Cleanup()).Path 144var projectFile = _env.CreateFile("1.proj", @"<Project> <Import Project='1.file' Condition=`Exists('1.file')`/> <ItemGroup><Compile Include='*.cs'/></ItemGroup> </Project>".Cleanup()).Path;
Evaluation\Evaluator_Tests.cs (4)
57TransientTestFile projectFile = env.CreateFile("project.proj", $@" 78TransientTestFile projectFile = env.CreateFile("project.proj", @$" 5017var tempPath = env.CreateFile(Guid.NewGuid().ToString(), testTargets); 5058env.CreateFile(testTargetPath, testtargets);
Graph\GetCompatiblePlatformGraph_Tests.cs (13)
51var proj2 = env.CreateFile("2.proj", @" 80var proj2 = env.CreateFile("2.proj", @" 91var proj3 = env.CreateFile("3.proj", @" 121var proj2 = env.CreateFile("2.proj", @" 133var proj3 = env.CreateFile("3.proj", @" 162var proj2 = env.CreateFile("2.proj", @" 173var proj3 = env.CreateFile("3.proj", @" 203var proj2 = env.CreateFile("2.proj", @" 230var proj2 = env.CreateFile("2.proj", @" 258var proj2 = env.CreateFile("2.proj", @" 285var proj2 = env.CreateFile("2.proj", @" 313var proj2 = env.CreateFile("2.proj", @" 342var proj2 = env.CreateFile("2.proj", @"
Graph\GraphLoadedFromSolution_tests.cs (8)
41files[i] = _env.CreateFile(files[i], string.Empty).Path; 69var solutionFile = _env.CreateFile("solutionReference.sln", string.Empty).Path; 231{"1", _env.CreateFile("1.csproj", string.Empty).Path} 252var solutionFile = _env.CreateFile("solution.sln", solutionContents).Path; 501var solutionFile = _env.CreateFile("solution.sln", solutionContents).Path; 596var graph = new ProjectGraph(_env.CreateFile("solution.sln", solutionContents).Path); 620var graph = new ProjectGraph(_env.CreateFile("solution.sln", solutionContents).Path); 673var solutionPath = _env.CreateFile("TheSolution.sln", solutionContents).Path;
Graph\IsolateProjects_Tests.cs (2)
568var referenceFile = _env.CreateFile( 582var projectFile = _env.CreateFile(
Graph\ProjectGraph_Tests.cs (16)
390env.CreateFile("2.proj", @" 396env.CreateFile("3.proj", @" 422TransientTestFile entryProject = env.CreateFile("1.proj", @" 442env.CreateFile("2.proj", @" 448env.CreateFile("3.proj", @" 454env.CreateFile("4.proj", @" 482env.CreateFile("2.proj", @" 488env.CreateFile("3.proj", @" 513env.CreateFile("2.proj", @" 519env.CreateFile("3.proj", @" 525env.CreateFile("4.proj", @" 555env.CreateFile("2.proj", @" 630TransientTestFile entryProject = env.CreateFile("1.proj", @" 817TransientTestFile slnFile = env.CreateFile(@"Solution.sln", SolutionFileContents); 2870TransientTestFile slnFile = env.CreateFile(@"Solution.sln", solutionFileContents); 2915TransientTestFile slnFile = env.CreateFile(@"Solution.sln", solutionFileContents);
Graph\ResultCacheBasedBuilds_Tests.cs (2)
56var existingFile = _env.CreateFile( 557var existingFile = _env.CreateFile("FileExists", string.Empty).Path;
ProjectCache\ProjectCacheTests.cs (5)
873var project1 = _env.CreateFile("1.proj", @" 880_env.CreateFile("2.proj", @" 1110var project = _env.CreateFile("1.proj", @$" 1327var project = _env.CreateFile( 1580.Select(i => _env.CreateFile($"project{i}.proj", project).Path)
Utilities_Tests.cs (1)
78TransientTestFile inputFile = env.CreateFile("tempInput.tmp", ObjectModelHelpers.CleanupFileContents(@"
Microsoft.Build.Tasks.UnitTests (28)
Copy_Tests.cs (2)
2942TransientTestFile sourceFile1 = env.CreateFile("source1.tmp", "This is the first source temp file."); // HIGHCHAR: Test writes in UTF8 without preamble. 2943TransientTestFile sourceFile2 = env.CreateFile("source2.tmp", "This is the second source temp file."); // HIGHCHAR: Test writes in UTF8 without preamble.
CreateCSharpManifestResourceName_Tests.cs (12)
386var csFile = env.CreateFile("SR1.cs", "namespace MyStuff.Namespace { class Class { } }"); 387var resXFile = env.CreateFile("SR1.resx", ""); 418var csFile = env.CreateFile("SR1.cs", "namespace MyStuff.Namespace { class Class { } }"); 420var resourceFile = env.CreateFile(ResourceFileName, ""); 490var resXFile = env.CreateFile("SR1.resx", ""); 523var conventionCSFile = env.CreateFile("SR1.cs", "namespace MyStuff.Namespace { class Class { } }"); 524var nonConventionCSFile = env.CreateFile("SR2.cs", "namespace MyStuff2.Namespace { class Class2 { } }"); 525var resXFile = env.CreateFile("SR1.resx", ""); 554var csFile = env.CreateFile("SR1.cs", "namespace MyStuff.Namespace { class Class { } }"); 555var resXFile = env.CreateFile("SR1.resx", ""); 588var csFile = env.CreateFile("SR1.cs", "namespace MyStuff.Namespace { class Class { } }"); 589var resXFile = env.CreateFile("SR1.de.resx", "");
Exec_Tests.cs (1)
1040var textFilePath = env.CreateFile("leading-whitespace.txt", lineWithLeadingWhitespace).Path;
HintPathResolver_Tests.cs (3)
34var tempFile = _env.CreateFile("FakeSystem.Net.Http.dll", ""); 54var tempFile = _env.CreateFile("FakeSystem.Net.Http.dll", ""); 63var tempFile = _env.CreateFile("FakeSystem.Net.Http.dll", "");
ResourceHandling\GenerateResource_Tests.cs (2)
2001TransientTestFile resource = env.CreateFile(".resx", @"<?xml version=""1.0"" encoding=""utf-8""?> 4124resgenFile = env.CreateFile(".resx", contents).Path;
RoslynCodeTaskFactory_Tests.cs (5)
294TransientTestFile file = testEnvironment.CreateFile(fileName: "236D48CE30064161B31B55DBF088C8B2", contents: "6159BD98607A460AA4F11D2FA92E5436"); 391TransientTestFile file = env.CreateFile(fileName: "CSharpClassSourceCodeFromFile.tmp", contents: taskClassSourceCode); 408TransientTestFile file = testEnvironment.CreateFile(fileName: "CSharpFragmentSourceCodeFromFile.tmp", contents: sourceCodeFileContents); 424TransientTestFile file = testEnvironment.CreateFile(fileName: "CSharpMethodSourceCodeFromFile.tmp", contents: sourceCodeFileContents); 600TransientTestFile file = testEnvironment.CreateFile(fileName: "CB3096DA4A454768AA9C0C4D422FC188.tmp", contents: sourceCodeFileContents);
Unzip_Tests.cs (1)
212TransientTestFile file = testEnvironment.CreateFile("foo.txt", "foo");
WriteLinesToFile_Tests.cs (1)
328var file = testEnv.CreateFile("FileToBeEmptied.txt", "Contents that should be erased");
ZipDirectory_Tests.cs (1)
112TransientTestFile file = testEnvironment.CreateFile("foo.zip", "foo");
Microsoft.Build.UnitTests.Shared (1)
ObjectModelHelpers.cs (1)
1740return env.CreateFile(projectNumber + ".proj", sb.ToString());