1 write to Path
Microsoft.Build.UnitTests.Shared (1)
TestEnvironment.cs (1)
772
Path
= folderPath ?? FileUtilities.GetTemporaryDirectory(createFolder, subfolder);
335 references to Path
Microsoft.Build.BuildCheck.UnitTests (32)
ConfigurationProvider_Tests.cs (10)
33
var configs = configurationProvider.GetConfiguration(Path.Combine(workFolder1.
Path
, "test.csproj"), "rule_id");
55
var configs = configurationProvider.GetConfiguration(Path.Combine(workFolder1.
Path
, "test.csproj"), "rule_id");
89
var customConfiguration = configurationProvider.GetCustomConfiguration(Path.Combine(workFolder1.
Path
, "test.csproj"), "rule_id");
115
var buildConfig = configurationProvider.GetUserConfiguration(Path.Combine(workFolder1.
Path
, "test.csproj"), "rule_id");
146
configurationProvider.GetCustomConfiguration(Path.Combine(workFolder1.
Path
, "test.csproj"), "rule_id");
151
configurationProvider.CheckCustomConfigurationDataValidity(Path.Combine(workFolder1.
Path
, "test123.csproj"), "rule_id");
178
configurationProvider.GetCustomConfiguration(Path.Combine(workFolder1.
Path
, "test.csproj"), "rule_id");
183
configurationProvider.CheckCustomConfigurationDataValidity(Path.Combine(workFolder1.
Path
, "test123.csproj"), "rule_id");
209
configurationProvider.GetCustomConfiguration(Path.Combine(workFolder1.
Path
, "test.csproj"), "rule_id");
214
configurationProvider.CheckCustomConfigurationDataValidity(Path.Combine(workFolder1.
Path
, "test123.csproj"), "rule_id");
EditorConfigParser_Tests.cs (4)
66
TransientTestFolder workFolder2 = testEnvironment.CreateFolder(Path.Combine(workFolder1.
Path
, "subfolder"), createFolder: true);
84
var listOfEditorConfigFile = parser.DiscoverEditorConfigFiles(Path.Combine(workFolder1.
Path
, "subfolder", "projectfile.proj")).ToList();
98
TransientTestFolder workFolder2 = testEnvironment.CreateFolder(Path.Combine(workFolder1.
Path
, "subfolder"), createFolder: true);
113
var listOfEditorConfigFile = parser.DiscoverEditorConfigFiles(Path.Combine(workFolder1.
Path
, "subfolder", "projectfile.proj")).ToList();
EndToEndTests.cs (17)
164
CopyFilesRecursively(Path.Combine(TestAssetsRootPath, testAssetsFolderName), workFolder.
Path
);
165
ReplaceStringInFile(Path.Combine(workFolder.
Path
, referencedProjectName, $"{referencedProjectName}.csproj"),
168
Path.Combine(workFolder.
Path
, referencedProjectName, "Resource1.resx"),
169
Path.Combine(workFolder.
Path
, referencedProjectName, $"Resource1.{resourceExtension}.resx"));
171
_env.SetCurrentDirectory(Path.Combine(workFolder.
Path
, entryProjectName));
178
string[] depsFiles = Directory.GetFiles(Path.Combine(workFolder.
Path
, entryProjectName), $"{entryProjectName}.deps.json", SearchOption.AllDirectories);
274
CopyFilesRecursively(Path.Combine(TestAssetsRootPath, testAssetsFolderName), workFolder.
Path
);
276
_env.SetCurrentDirectory(Path.Combine(workFolder.
Path
, entryProjectName));
386
CopyFilesRecursively(Path.Combine(TestAssetsRootPath, testAssetsFolderName), workFolder.
Path
);
387
ReplaceStringInFile(Path.Combine(workFolder.
Path
, $"{projectName}.csproj"),
390
_env.SetCurrentDirectory(workFolder.
Path
);
477
_env.SetCurrentDirectory(workFolder.
Path
);
962
File.Copy(nugetTemplatePath, Path.Combine(workFolder.
Path
, nugetTemplateName));
963
AddCustomDataSourceToNugetConfig(workFolder.
Path
);
976
var creationLog = ExecuteDotnetCommand($"new {templateShortName} -n {projectName} --MicrosoftBuildVersion {BuildCheckUnitTestsConstants.MicrosoftBuildPackageVersion} -o {workFolder.
Path
} ");
978
var buildLog = ExecuteDotnetCommand($"build {workFolder.
Path
}");
1089
.Replace("WorkFolderPath", workFolder.
Path
);
TestAssemblyInfo.cs (1)
87
_testEnvironment.SetTempPath(assemblyTempFolder.
Path
);
Microsoft.Build.CommandLine.UnitTests (27)
PerfLog_Tests.cs (5)
30
testEnv.SetEnvironmentVariable("DOTNET_PERFLOG_DIR", perfLogFolder.
Path
);
42
string projectPath = Path.Combine(projectFolder.
Path
, "ClassLibrary.csproj");
52
string[] files = Directory.GetFiles(perfLogFolder.
Path
, "perf-*.log");
65
string perfLogPath = Path.Combine(perfLogFolder.
Path
, "logs");
78
string projectPath = Path.Combine(projectFolder.
Path
, "ClassLibrary.csproj");
TestAssemblyInfo.cs (1)
87
_testEnvironment.SetTempPath(assemblyTempFolder.
Path
);
XMake_BinlogSwitch_Tests.cs (11)
43
string binlogPath = Path.Combine(directory.
Path
, "test.binlog");
62
string binlogPath1 = Path.Combine(directory.
Path
, "test1.binlog");
63
string binlogPath2 = Path.Combine(directory.
Path
, "test2.binlog");
85
string binlogPattern = Path.Combine(directory.
Path
, "build-{}.binlog");
92
string[] binlogFiles = Directory.GetFiles(directory.
Path
, "build-*.binlog");
93
binlogFiles.Length.ShouldBe(1, $"Expected exactly one binlog file to be created in {directory.
Path
}");
111
string binlogPattern = Path.Combine(directory.
Path
, "build-{}-test-{}.binlog");
118
string[] binlogFiles = Directory.GetFiles(directory.
Path
, "build-*-test-*.binlog");
119
binlogFiles.Length.ShouldBe(1, $"Expected exactly one binlog file to be created in {directory.
Path
}");
136
string binlogPath = Path.Combine(directory.
Path
, "test.binlog");
160
string binlogPath = Path.Combine(directory.
Path
, "test.binlog");
XMake_Tests.cs (10)
1348
string directory = _env.DefaultTestDirectory.
Path
;
1376
env.SetCurrentDirectory(folder.
Path
);
1571
var msbuildParameters = "\"" + directory.
Path
+ "\"";
1615
output.ShouldContain($"[A={directory.
Path
}{Path.DirectorySeparatorChar}]");
2646
var dllFilePath = Path.Combine(tempDir.
Path
, expectedLoggerName);
2755
string binLogLocation = _env.DefaultTestDirectory.
Path
;
2778
string binLogLocation = _env.DefaultTestDirectory.
Path
;
2817
string binLogLocation = _env.DefaultTestDirectory.
Path
;
2857
string binLogLocation = _env.DefaultTestDirectory.
Path
;
3240
var tempLoggerProjDir = Path.Combine(tempDir.
Path
, "LoggerProject");
Microsoft.Build.Engine.OM.UnitTests (3)
Construction\ConstructionEditing_Tests.cs (1)
3210
var testSdkRoot = env.CreateFolder().
Path
;
Definition\ProjectItem_Tests.cs (1)
452
IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment(itemDefinition.Replace("somedir", directory.
Path
), allItems: false, ignoreCondition: true);
TestAssemblyInfo.cs (1)
87
_testEnvironment.SetTempPath(assemblyTempFolder.
Path
);
Microsoft.Build.Engine.UnitTests (134)
BackEnd\BuildRequestConfiguration_Tests.cs (1)
566
project.FullPath = _env.CreateFolder().
Path
;
BackEnd\IntrinsicTask_Tests.cs (2)
2525
env.SetCurrentDirectory(projectDirectory.
Path
);
2535
<i1 Remove='" + projectDirectory.
Path
+ Path.DirectorySeparatorChar + @"*.tmp'/>
BackEnd\SdkResolverLoader_Tests.cs (9)
220
var root = env.CreateFolder().
Path
;
245
var root = env.CreateFolder().
Path
;
272
var root = env.CreateFolder().
Path
;
296
var root = env.CreateFolder().
Path
;
312
var root = env.CreateFolder().
Path
;
339
var testRoot = env.CreateFolder().
Path
;
367
var testRoot = env.CreateFolder().
Path
;
368
var additionalRoot = env.CreateFolder().
Path
;
447
var testRoot = env.CreateFolder().
Path
;
BackEnd\SdkResultOutOfProc_Tests.cs (2)
105
string projectFolder = _env.CreateFolder().
Path
;
140
string projectFolder = _env.CreateFolder().
Path
;
BackEnd\TaskExecutionHost_Tests.cs (1)
1072
var transientEnvVar = env.SetEnvironmentVariable("MSBUILDDEBUGPATH", debugFolder.
Path
);
BackEnd\TaskHostCallback_Tests.cs (2)
73
string testDir = env.CreateFolder().
Path
;
218
string testDir = env.CreateFolder().
Path
;
BackEnd\TaskRouter_IntegrationTests.cs (1)
40
_testProjectsDir = _env.CreateFolder().
Path
;
BinaryLogger_Tests.cs (12)
345
RunnerUtilities.ExecMSBuild($"{_logFile} -flp:logfile={Path.Combine(logFolder.
Path
, "logFile.log")};verbosity=diagnostic", out success);
348
string text = File.ReadAllText(Path.Combine(logFolder.
Path
, "logFile.log"));
402
RunnerUtilities.ExecMSBuild($"{projectFile.Path} -nr:False -bl:{_logFile} -flp1:logfile={Path.Combine(logFolder.
Path
, "logFile.log")};verbosity=diagnostic -flp2:logfile={Path.Combine(logFolder.
Path
, "logFile2.log")};verbosity=normal", out bool success);
407
string text = File.ReadAllText(Path.Combine(logFolder.
Path
, "logFile.log"));
411
string text2 = File.ReadAllText(Path.Combine(logFolder.
Path
, "logFile2.log"));
414
RunnerUtilities.ExecMSBuild($"{_logFile} -flp1:logfile={Path.Combine(logFolder.
Path
, "logFile3.log")};verbosity=diagnostic -flp2:logfile={Path.Combine(logFolder.
Path
, "logFile4.log")};verbosity=normal", out success);
416
text = File.ReadAllText(Path.Combine(logFolder.
Path
, "logFile3.log"));
420
text2 = File.ReadAllText(Path.Combine(logFolder.
Path
, "logFile4.log"));
465
string symlinkPath = Path.Combine(testFolder2.
Path
, symlinkName);
466
string symlinkLvl2Path = Path.Combine(testFolder2.
Path
, symlinkLvl2Name);
CLR2TaskHost_E2E_Tests.cs (1)
59
string projectPath = Path.Combine(testFolder.
Path
, "CLR2ExplicitTest.proj");
Construction\SolutionFile_OldParser_Tests.cs (3)
775
env.CreateFolder(Path.Combine(solutionFolder.
Path
, "RelativePath"));
778
p.FullPath = Path.Combine(solutionFolder.
Path
, "RelativePath", "project file");
779
p.SolutionFileDirectory = Path.GetFullPath(solutionFolder.
Path
);
Construction\SolutionFilter_Tests.cs (8)
54
TransientTestFolder classLibFolder = testEnvironment.CreateFolder(Path.Combine(folder.
Path
, "ClassLibrary"), createFolder: true);
55
TransientTestFolder classLibSubFolder = testEnvironment.CreateFolder(Path.Combine(classLibFolder.
Path
, "ClassLibrary"), createFolder: true);
64
TransientTestFolder simpleProjectFolder = testEnvironment.CreateFolder(Path.Combine(folder.
Path
, "SimpleProject"), createFolder: true);
65
TransientTestFolder simpleProjectSubFolder = testEnvironment.CreateFolder(Path.Combine(simpleProjectFolder.
Path
, "SimpleProject"), createFolder: true);
232
TransientTestFolder src = testEnvironment.CreateFolder(Path.Combine(folder.
Path
, "src"), createFolder: true);
293
folder = testEnvironment.CreateFolder(Path.Combine(folder.
Path
, $"test@folder%special$symbols"), createFolder: true);
394
TransientTestFolder src = testEnvironment.CreateFolder(Path.Combine(folder.
Path
, "src"), createFolder: true);
395
TransientTestFolder nested = testEnvironment.CreateFolder(Path.Combine(src.
Path
, "nested"), createFolder: true);
Construction\SolutionProjectGenerator_Tests.cs (6)
122
TransientTestFolder classLibFolder = testEnvironment.CreateFolder(Path.Combine(folder.
Path
, "classlib"), createFolder: true);
132
TransientTestFolder simpleProjectFolder = testEnvironment.CreateFolder(Path.Combine(folder.
Path
, "simpleProject"), createFolder: true);
167
TransientTestFolder classLibFolder = testEnvironment.CreateFolder(Path.Combine(folder.
Path
, "classlib"), createFolder: true);
183
TransientTestFolder simpleProjectFolder = testEnvironment.CreateFolder(Path.Combine(folder.
Path
, "simpleProject"), createFolder: true);
242
TransientTestFolder classLibFolder = testEnvironment.CreateFolder(Path.Combine(folder.
Path
, "classlib"), createFolder: true);
258
TransientTestFolder simpleProjectFolder = testEnvironment.CreateFolder(Path.Combine(folder.
Path
, "simpleProject"), createFolder: true);
Definition\ProjectEvaluationContext_Tests.cs (34)
123
{Path.Combine(_env.DefaultTestDirectory.
Path
, "1.file"), 1},
124
{Path.Combine(_env.DefaultTestDirectory.
Path
, "2.file"), 1}
181
{ _env.DefaultTestDirectory.
Path
, 1},
182
{ Path.Combine(_env.DefaultTestDirectory.
Path
, "1.file"), 2 }
187
{ _env.DefaultTestDirectory.
Path
, 1 }
372
var projectDirectory = _env.DefaultTestDirectory.
Path
;
431
var projectDirectory1 = _env.DefaultTestDirectory.CreateDirectory("1").
Path
;
432
var projectDirectory2 = _env.DefaultTestDirectory.CreateDirectory("2").
Path
;
482
var project1Directory = project1Root.CreateDirectory("1").
Path
;
483
var project1GlobDirectory = project1Root.CreateDirectory("Glob").CreateDirectory("1").
Path
;
486
var project2Directory = project2Root.CreateDirectory("2").
Path
;
487
var project2GlobDirectory = project2Root.CreateDirectory("Glob").CreateDirectory("2").
Path
;
547
var project1GlobDirectory = project1Directory.CreateDirectory("Glob").CreateDirectory("1").
Path
;
562
Path.Combine(project1Directory.
Path
, "1"),
570
Path.Combine(project2Directory.
Path
, "2"),
573
<i Include=`{Path.Combine(project1Directory.
Path
, "Glob", "**", "*.cs")}` />
591
.Select(i => Path.Combine(project1Directory.
Path
, i))
622
File.WriteAllText(Path.Combine(globDirectory.
Path
, $"{evaluationCount}.cs"), "");
628
Path.Combine(project1Directory.
Path
, "1"),
635
Path.Combine(project2Directory.
Path
, "2"),
660
File.WriteAllText(Path.Combine(globDirectory.
Path
, $"{evaluationCount}.cs"), "");
687
: globDirectory.
Path
;
689
Directory.CreateDirectory(globDirectory.
Path
);
720
.Select((p, i) => new ProjectSpecification(Path.Combine(testDirectory.
Path
, $"ProjectDirectory{i}", $"Project{i}.proj"), p));
726
File.WriteAllText(Path.Combine(globDirectory.
Path
, $"{evaluationCount}.cs"), "");
736
File.WriteAllText(Path.Combine(globDirectory.
Path
, $"{evaluationCount}.cs"), "");
757
var projectDirectory = _env.DefaultTestDirectory.
Path
;
800
var projectDirectory = _env.DefaultTestDirectory.
Path
;
862
<SearchedPath>$([MSBuild]::GetDirectoryNameOfFileAbove('{subdirectory.
Path
}', 'a'))</SearchedPath>
876
searchedPath.EvaluatedValue.ShouldBe(subdirectory.
Path
);
882
? subdirectory.
Path
883
: _env.DefaultTestDirectory.
Path
);
918
<SearchedPath>$([MSBuild]::GetPathOfFileAbove('a', '{subdirectory.
Path
}'))</SearchedPath>
958
projectContents.Select((p, i) => new ProjectSpecification(Path.Combine(_env.DefaultTestDirectory.
Path
, $"Project{i}.proj"), p)),
Evaluation\Evaluator_Tests.cs (1)
80
<Import {importParameter.Replace("realFolder", existentDirectory.
Path
)} />
Evaluation\Expander_Tests.cs (8)
4908
includes.ShouldContain(root.
Path
);
4909
includes.ShouldContain(alpha.
Path
);
4910
includes.ShouldContain(beta.
Path
);
4911
includes.ShouldNotContain(gamma.
Path
);
4952
includes.ShouldContain(root.
Path
);
4953
includes.ShouldContain(alpha.
Path
);
4954
includes.ShouldContain(beta.
Path
);
4955
includes.ShouldContain(gamma.
Path
);
Evaluation\IntrinsicFunctionOverload_Tests.cs (3)
133
string testFilePath = Path.Combine(env.DefaultTestDirectory.
Path
, "TestFile.txt");
173
string testDirPath = Path.Combine(env.DefaultTestDirectory.
Path
, "TestDir");
214
string testDirPath = Path.Combine(env.DefaultTestDirectory.
Path
, "TestDir");
Evaluation\Preprocessor_Tests.cs (4)
850
string testSdkDirectory = env.CreateFolder().
Path
;
941
string testDirectory = env.CreateFolder().
Path
;
1056
string sdk1 = env.CreateFolder().
Path
;
1057
string sdk2 = env.CreateFolder().
Path
;
Evaluation\ProjectSdkImplicitImport_Tests.cs (2)
88
_testSdkRoot = _env.CreateFolder().
Path
;
354
var projectFolder = _env.CreateFolder().
Path
;
Evaluation\SdkResultEvaluation_Tests.cs (1)
41
_testFolder = _env.CreateFolder().
Path
;
FileMatcher_Tests.cs (11)
65
File.WriteAllBytes(Path.Combine(testFolder.
Path
, file), new byte[1]);
68
string[] fileMatches = FileMatcher.Default.GetFiles(testFolder.
Path
, pattern).FileList;
79
TransientTestFolder tf2 = _env.CreateFolder(Path.Combine(testFolder.
Path
, "subfolder"));
80
string symlinkPath = Path.Combine(tf2.
Path
, "mySymlink");
83
Directory.CreateSymbolicLink(symlinkPath, testFolder.
Path
);
84
string[] fileMatches = FileMatcher.Default.GetFiles(testFolder.
Path
, "**").FileList;
104
foreach (string fullPath in GetFilesComplexGlobbingMatchingInfo.FilesToCreate.Select(i => Path.Combine(testFolder.
Path
, i.ToPlatformSlash())))
113
string[] matchedFiles = fileMatcher.GetFiles(testFolder.
Path
, include, excludes?.ToList()).FileList;
1249
string workingPath = _env.CreateFolder().
Path
;
1263
string workingPath = _env.CreateFolder().
Path
;
1280
string workingPath = _env.CreateFolder().
Path
;
Graph\GetCompatiblePlatformGraph_Tests.cs (6)
354
TransientTestFolder project1Folder = testEnvironment.CreateFolder(Path.Combine(folder.
Path
, firstProjectName), createFolder: true);
355
TransientTestFolder project1SubFolder = testEnvironment.CreateFolder(Path.Combine(project1Folder.
Path
, firstProjectName), createFolder: true);
369
TransientTestFolder project2Folder = testEnvironment.CreateFolder(Path.Combine(folder.
Path
, secondProjectName), createFolder: true);
370
TransientTestFolder project2SubFolder = testEnvironment.CreateFolder(Path.Combine(project2Folder.
Path
, secondProjectName), createFolder: true);
380
TransientTestFolder project3Folder = testEnvironment.CreateFolder(Path.Combine(folder.
Path
, thirdProjectName), createFolder: true);
381
TransientTestFolder project3SubFolder = testEnvironment.CreateFolder(Path.Combine(project3Folder.
Path
, thirdProjectName), createFolder: true);
Graph\ProjectGraph_Tests.cs (8)
844
string project1Path = Path.Combine(env.DefaultTestDirectory.
Path
, "Project1.csproj");
845
string project2Path = Path.Combine(env.DefaultTestDirectory.
Path
, "Project2.vcxproj");
846
string project3Path = Path.Combine(env.DefaultTestDirectory.
Path
, "Project3.vcxproj");
847
string project4Path = Path.Combine(env.DefaultTestDirectory.
Path
, "Project4.vcxproj");
848
string project5Path = Path.Combine(env.DefaultTestDirectory.
Path
, "Project5.vcxproj");
849
string project6Path = Path.Combine(env.DefaultTestDirectory.
Path
, "Project6.wapproj");
850
string project7Path = Path.Combine(env.DefaultTestDirectory.
Path
, "Project7.csproj");
851
string project8Path = Path.Combine(env.DefaultTestDirectory.
Path
, "Project8.csproj");
MSBuildTaskHostTests.cs (2)
34
CopyFilesRecursively(Path.Combine(TestAssetsRootPath, "Net35WinFormsApp"), testFolder.
Path
);
35
string projectFilePath = Path.Combine(testFolder.
Path
, "TestNet35WinForms.csproj");
ProjectCache\ProjectCacheTests.cs (1)
1737
string appDllPath = Path.Combine(directory.
Path
, $"bin/{s_currentTargetNETFramework}/app.dll");
TerminalLogger_Tests.cs (2)
919
RunnerUtilities.ExecMSBuild($"{projectFile.Path} /bl:{logFileWithTL} -flp:logfile={Path.Combine(logFolder.
Path
, "logFileWithTL.log")};verbosity=diagnostic -tl:on", out bool success, outputHelper: _outputHelper);
923
RunnerUtilities.ExecMSBuild($"{projectFile.Path} /bl:{logFileWithoutTL} -flp:logfile={Path.Combine(logFolder.
Path
, "logFileWithoutTL.log")};verbosity=diagnostic", out success, outputHelper: _outputHelper);
TestAssemblyInfo.cs (1)
87
_testEnvironment.SetTempPath(assemblyTempFolder.
Path
);
TypeLoader_Tests.cs (2)
105
string newAssemblyLocation = Path.Combine(folder.
Path
, Path.GetFileName(currentAssembly));
110
File.Copy(utilities, Path.Combine(folder.
Path
, utilitiesName));
Microsoft.Build.Framework.UnitTests (1)
TestAssemblyInfo.cs (1)
87
_testEnvironment.SetTempPath(assemblyTempFolder.
Path
);
Microsoft.Build.Tasks.UnitTests (104)
AddToWin32Manifest_Tests.cs (3)
44
var tempOutput = env.CreateFolder().
Path
;
82
var outputPath = env.CreateFolder().
Path
;
109
File.Copy(Path.Combine(TestAssetsRootPath, manifestName), Path.Combine(projectFolder.
Path
, manifestName));
Copy_Tests.cs (16)
178
DestinationFolder = new TaskItem(destinationFolder.
Path
),
221
SourceFolders = new ITaskItem[] { new TaskItem(s0Folder.
Path
), new TaskItem(s1Folder.
Path
) },
222
DestinationFolder = new TaskItem(destinationFolder.
Path
),
231
Directory.Exists(Path.Combine(destinationFolder.
Path
, "source0")).ShouldBeTrue();
232
Directory.Exists(Path.Combine(destinationFolder.
Path
, "source1")).ShouldBeTrue();
248
DestinationFolder = new TaskItem(destinationFolder.
Path
),
279
SourceFolders = new ITaskItem[] { new TaskItem(sourceFolder.
Path
) },
280
DestinationFolder = new TaskItem(destinationFolder.
Path
),
305
DestinationFolder = new TaskItem(destinationFolder.
Path
),
330
DestinationFolder = new TaskItem(destinationFolder.
Path
),
381
DestinationFolder = new TaskItem(destinationFolder.
Path
),
405
SourceFolders = new ITaskItem[] { new TaskItem(sourceFolder.
Path
) },
1127
var sourceFile = FileUtilities.GetTemporaryFile(env.DefaultTestDirectory.
Path
, null, "src", false);
1128
var destinationFile = FileUtilities.GetTemporaryFile(env.DefaultTestDirectory.
Path
, null, "dst", false);
3009
string destFile = Path.Combine(destFolder.
Path
, "The Destination");
CreateCSharpManifestResourceName_Tests.cs (1)
460
env.SetCurrentDirectory(env.DefaultTestDirectory.
Path
);
DownloadFile_Tests.cs (9)
38
DestinationFolder = new TaskItem(folder.
Path
),
68
DestinationFolder = new TaskItem(folder.
Path
),
79
FileInfo file = new FileInfo(Path.Combine(folder.
Path
, "foo.txt"));
117
DestinationFolder = new TaskItem(folder.
Path
),
125
FileInfo file = new FileInfo(Path.Combine(folder.
Path
, filename));
148
DestinationFolder = new TaskItem(folder.
Path
),
160
FileInfo file = new FileInfo(Path.Combine(folder.
Path
, filename));
216
DestinationFolder = new TaskItem(folder.
Path
),
332
DestinationFolder = new TaskItem(folder.
Path
),
GenerateBindingRedirects_Tests.cs (1)
268
TransientTestFolder testFolder = env.CreateFolder(Path.Combine(rootTestFolder.
Path
, "\uD873\uDD02\u9FA8\u82D8\u722B\u9EA4\u03C5\u33D1\uE038\u486B\u0033"));
GetSDKReference_Tests.cs (2)
277
GetSDKReferenceFiles.SDKFilesCache cache = new(null, folder.
Path
, null, null, null);
279
GetSDKReferenceFiles.SDKFilesCache cache2 = new(null, folder.
Path
, null, null, null);
HintPathResolver_Tests.cs (1)
45
var longTempFilePath = tempfolder.
Path
+ "\\..\\tempfolder_for_CanResolveLongHintPath\\..\\tempfolder_for_CanResolveLongHintPath\\..\\tempfolder_for_CanResolveLongHintPath\\..\\tempfolder_for_CanResolveLongHintPath\\..\\tempfolder_for_CanResolveLongHintPath\\..\\tempfolder_for_CanResolveLongHintPath\\..\\tempfolder_for_CanResolveLongHintPath\\..\\tempfolder_for_CanResolveLongHintPath\\FakeSystem.Net.Http.dll";
MSBuildInternalMessage_Tests.cs (5)
27
var outputPath = env.CreateFolder().
Path
;
72
var outputPath = env.CreateFolder().
Path
;
118
var outputPath = env.CreateFolder().
Path
;
196
var outputPath = env.CreateFolder().
Path
;
250
var outputPath = env.CreateFolder().
Path
;
PortableTasks_Tests.cs (1)
50
var folder = env.CreateFolder().
Path
;
RemoveDir_Tests.cs (1)
57
list.Add(new TaskItem(env.CreateFolder().
Path
));
ResolveAssemblyReference_CustomCultureTests.cs (2)
46
var solutionPath = solutionFolder.
Path
;
50
var projBOutputPath = env.CreateFolder().
Path
;
ResourceHandling\GenerateResource_Tests.cs (2)
3937
env.SetCurrentDirectory(env.DefaultTestDirectory.
Path
);
3943
env.CreateFolder(Path.Combine(env.DefaultTestDirectory.
Path
, "tmp_dir")),
ResourceHandling\MSBuildResXReader_Tests.cs (1)
179
Path.Combine(baseDir.
Path
, nameof(LoadsStringFromFileRefAsStringWithShiftJISEncoding) + ".resx"),
RoslynCodeTaskFactory_Tests.cs (9)
128
string output = RunnerUtilities.ExecMSBuild(assemblyProj.Path + $" /p:OutDir={Path.Combine(folder.
Path
, "subFolder")} /restore", out bool success);
136
<Reference Include=""{Path.Combine(folder.
Path
, "subFolder", "5106.dll")}"" />
1189
TransientTestFolder project1Folder = env.CreateFolder(Path.Combine(rootFolder.
Path
, "Project1"), createFolder: true);
1190
TransientTestFolder project2Folder = env.CreateFolder(Path.Combine(rootFolder.
Path
, "Project2"), createFolder: true);
1281
string projectFilePath = Path.Combine(testFolder.
Path
, "test.proj");
1331
string projectFilePath = Path.Combine(projectFolder.
Path
, "test.proj");
1376
TransientTestFolder projectFolder = env.CreateFolder(Path.Combine(rootFolder.
Path
, "Project"), createFolder: true);
1377
string projectFilePath = Path.Combine(projectFolder.
Path
, "test.proj");
1493
string projectFilePath = Path.Combine(testFolder.
Path
, "test.proj");
TestAssemblyInfo.cs (1)
87
_testEnvironment.SetTempPath(assemblyTempFolder.
Path
);
Unzip_Tests.cs (34)
38
DestinationFolder = new TaskItem(source.
Path
),
67
DestinationFolder = new TaskItem(destination.
Path
),
81
DestinationFolder = new TaskItem(destination.
Path
),
90
_mockEngine.Log.ShouldContain(Path.Combine(destination.
Path
, "BE78A17D30144B549D21F71D5C633F7D.txt"), customMessage: _mockEngine.Log);
91
_mockEngine.Log.ShouldContain(Path.Combine(destination.
Path
, "A04FF4B88DF14860B7C73A8E75A4FB76.txt"), customMessage: _mockEngine.Log);
97
DestinationFolder = new TaskItem(destination.
Path
),
127
DestinationFolder = new TaskItem(destination.
Path
),
136
_mockEngine.Log.ShouldContain(Path.Combine(destination.
Path
, "BE78A17D30144B549D21F71D5C633F7D.txt"), customMessage: _mockEngine.Log);
137
_mockEngine.Log.ShouldContain(Path.Combine(destination.
Path
, "A04FF4B88DF14860B7C73A8E75A4FB76.txt"), customMessage: _mockEngine.Log);
138
_mockEngine.Log.ShouldContain(Path.Combine(destination.
Path
, "subdir", "F83E9633685494E53BEF3794EDEEE6A6.txt"), customMessage: _mockEngine.Log);
139
_mockEngine.Log.ShouldContain(Path.Combine(destination.
Path
, "subdir", "21D6D4596067723B3AC5DF9A8B3CBFE7.txt"), customMessage: _mockEngine.Log);
140
Directory.Exists(Path.Combine(destination.
Path
, "emptyDir"));
197
DestinationFolder = new TaskItem(source.
Path
),
222
DestinationFolder = new TaskItem(folder.
Path
),
243
DestinationFolder = new TaskItem(folder.
Path
),
244
SourceFiles = new ITaskItem[] { new TaskItem(Path.Combine(testEnvironment.DefaultTestDirectory.
Path
, "foo.zip")), },
269
DestinationFolder = new TaskItem(destination.
Path
),
279
_mockEngine.Log.ShouldContain(Path.Combine(destination.
Path
, "BE78A17D30144B549D21F71D5C633F7D.txt"), customMessage: _mockEngine.Log);
280
_mockEngine.Log.ShouldNotContain(Path.Combine(destination.
Path
, "A04FF4B88DF14860B7C73A8E75A4FB76.txt"), customMessage: _mockEngine.Log);
299
DestinationFolder = new TaskItem(destination.
Path
),
309
_mockEngine.Log.ShouldNotContain(Path.Combine(destination.
Path
, "BE78A17D30144B549D21F71D5C633F7D.txt"), customMessage: _mockEngine.Log);
310
_mockEngine.Log.ShouldContain(Path.Combine(destination.
Path
, "A04FF4B88DF14860B7C73A8E75A4FB76.txt"), customMessage: _mockEngine.Log);
333
DestinationFolder = new TaskItem(destination.
Path
),
344
_mockEngine.Log.ShouldContain(Path.Combine(destination.
Path
, "file1.js"), customMessage: _mockEngine.Log);
345
_mockEngine.Log.ShouldNotContain(Path.Combine(destination.
Path
, "file1.js.map"), customMessage: _mockEngine.Log);
346
_mockEngine.Log.ShouldContain(Path.Combine(destination.
Path
, "file2.js"), customMessage: _mockEngine.Log);
347
_mockEngine.Log.ShouldNotContain(Path.Combine(destination.
Path
, "readme.txt"), customMessage: _mockEngine.Log);
348
_mockEngine.Log.ShouldNotContain(Path.Combine(destination.
Path
, "sub", "subfile.js"), customMessage: _mockEngine.Log);
367
DestinationFolder = new TaskItem(destination.
Path
),
396
DestinationFolder = new TaskItem(destination.
Path
),
425
DestinationFolder = new TaskItem(destination.
Path
),
454
DestinationFolder = new TaskItem(destination.
Path
),
489
DestinationFolder = new TaskItem(destination.
Path
),
496
string unzippedFilePath = Path.Combine(destination.
Path
, executableName);
WriteCodeFragment_Tests.cs (4)
109
TaskItem folder = new TaskItem(env.CreateFolder(folderPath: null, createFolder: false).
Path
);
132
TaskItem file = new TaskItem(Path.Combine(env.CreateFolder(folderPath: null, createFolder: false).
Path
, "File.tmp"));
411
TaskItem folder = new TaskItem(env.CreateFolder(folderPath: null, createFolder: false).
Path
);
433
string absoluteFolder = env.CreateFolder().
Path
;
WriteLinesToFile_Tests.cs (5)
320
var file = Path.Combine(directory.
Path
, $"{Guid.NewGuid().ToString("N")}.tmp");
331
Directory.Exists(directory.
Path
).ShouldBeFalse();
335
Directory.Exists(directory.
Path
).ShouldBeTrue();
399
var outputFile = Path.Combine(testEnv.DefaultTestDirectory.
Path
, "output.txt");
460
var outputFile = Path.Combine(testEnv.DefaultTestDirectory.
Path
, "output.txt");
ZipDirectory_Tests.cs (6)
47
string zipFilePath = Path.Combine(testEnvironment.CreateFolder(createFolder: true).
Path
, "test.zip");
54
SourceDirectory = new TaskItem(sourceFolder.
Path
),
60
_mockEngine.Log.ShouldContain(sourceFolder.
Path
, customMessage: _mockEngine.Log);
113
SourceDirectory = new TaskItem(sourceFolder.
Path
),
119
_mockEngine.Log.ShouldContain(sourceFolder.
Path
, customMessage: _mockEngine.Log);
151
SourceDirectory = new TaskItem(folder.
Path
),
Microsoft.Build.UnitTests.Shared (20)
EngineTestEnvironment.cs (1)
113
public string TestRoot => _folder.
Path
;
TestEnvironment.cs (19)
202
return SetTempPath(folder.
Path
, true);
211
return WithTransientTestState(SetTempPath(folder.
Path
, true));
242
return WithTransientTestState(new TransientTestFile(transientTestFolder.
Path
, fileName, contents));
253
return WithTransientTestState(new TransientTestFile(transientTestFolder.
Path
, extension,
276
return WithTransientTestState(new TransientTestFile(transientTestFolder.
Path
, extension,
309
Assert.True(!(createFolder ^ FileSystems.Default.DirectoryExists(folder.
Path
)));
776
Directory.CreateDirectory(
Path
);
782
return new TransientTestFolder(System.IO.Path.Combine(
Path
, directoryName));
787
return new TransientTestFile(
Path
, fileName, contents);
796
Path
.ShouldNotBeNullOrEmpty();
797
Path
.ShouldNotBe(@"\");
798
Path
.ShouldNotBe(@"/");
799
System.IO.Path.GetFullPath(
Path
).ShouldNotBe(System.IO.Path.GetFullPath(System.IO.Path.GetTempPath()));
800
System.IO.Path.IsPathRooted(
Path
).ShouldBeTrue($"{
Path
} is not rooted");
802
FileUtilities.DeleteDirectoryNoThrow(
Path
, true);
852
Directory.CreateDirectory(destination.
Path
);
854
string path = System.IO.Path.Combine(destination.
Path
, filename);
856
ZipFile.CreateFromDirectory(source.
Path
, path);
Microsoft.Build.Utilities.UnitTests (14)
TestAssemblyInfo.cs (1)
87
_testEnvironment.SetTempPath(assemblyTempFolder.
Path
);
ToolLocationHelper_Tests.cs (12)
2501
string rootDir = Path.Combine(env.DefaultTestDirectory.
Path
, "framework-root");
2530
string customFrameworkRootPath = Path.Combine(env.DefaultTestDirectory.
Path
, "framework-root");
2553
string rootDir = Path.Combine(env.CreateFolder().
Path
, "framework-root");
2554
string fallbackPath = Path.Combine(env.CreateFolder().
Path
, "framework-root");
2584
string customFrameworkDirToUse = Path.Combine(env.CreateFolder().
Path
, "framework-root");
2597
string customFrameworkDirToUse = Path.Combine(env.CreateFolder().
Path
, "framework-root");
2599
string rootDir = env.CreateFolder().
Path
;
2614
string customFrameworkDirToUse = Path.Combine(env.CreateFolder().
Path
, "framework-root");
2631
string customFrameworkDirToUse = Path.Combine(env.CreateFolder().
Path
, "framework-root");
2646
string customFrameworkDirToUse = Path.Combine(env.CreateFolder().
Path
, "framework-root");
2648
string rootDir = env.CreateFolder().
Path
;
2663
string customFrameworkDirToUse = Path.Combine(env.CreateFolder().
Path
, "framework-root");
ToolTask_Tests.cs (1)
726
string tempDirectory = env.CreateFolder().
Path
;