1 write to Path
Microsoft.Build.UnitTests.Shared (1)
TestEnvironment.cs (1)
730
Path
= folderPath ?? FileUtilities.GetTemporaryDirectory(createFolder, subfolder);
292 references to Path
Microsoft.Build.BuildCheck.UnitTests (31)
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 (16)
163
CopyFilesRecursively(Path.Combine(TestAssetsRootPath, testAssetsFolderName), workFolder.
Path
);
164
ReplaceStringInFile(Path.Combine(workFolder.
Path
, referencedProjectName, $"{referencedProjectName}.csproj"),
167
Path.Combine(workFolder.
Path
, referencedProjectName, "Resource1.resx"),
168
Path.Combine(workFolder.
Path
, referencedProjectName, $"Resource1.{resourceExtension}.resx"));
170
_env.SetCurrentDirectory(Path.Combine(workFolder.
Path
, entryProjectName));
177
string[] depsFiles = Directory.GetFiles(Path.Combine(workFolder.
Path
, entryProjectName), $"{entryProjectName}.deps.json", SearchOption.AllDirectories);
273
CopyFilesRecursively(Path.Combine(TestAssetsRootPath, testAssetsFolderName), workFolder.
Path
);
275
_env.SetCurrentDirectory(Path.Combine(workFolder.
Path
, entryProjectName));
374
CopyFilesRecursively(Path.Combine(TestAssetsRootPath, testAssetsFolderName), workFolder.
Path
);
375
ReplaceStringInFile(Path.Combine(workFolder.
Path
, $"{projectName}.csproj"),
378
_env.SetCurrentDirectory(workFolder.
Path
);
876
File.Copy(nugetTemplatePath, Path.Combine(workFolder.
Path
, nugetTemplateName));
877
AddCustomDataSourceToNugetConfig(workFolder.
Path
);
890
var creationLog = ExecuteDotnetCommand($"new {templateShortName} -n {projectName} --MicrosoftBuildVersion {BuildCheckUnitTestsConstants.MicrosoftBuildPackageVersion} -o {workFolder.
Path
} ");
892
var buildLog = ExecuteDotnetCommand($"build {workFolder.
Path
}");
976
.Replace("WorkFolderPath", workFolder.
Path
);
TestAssemblyInfo.cs (1)
73
_testEnvironment.SetTempPath(assemblyTempFolder.
Path
);
Microsoft.Build.CommandLine.UnitTests (13)
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");
TerminalLogger_Tests.cs (2)
733
RunnerUtilities.ExecMSBuild($"{projectFile.Path} /m /bl:{logFileWithTL} -flp:logfile={Path.Combine(logFolder.
Path
, "logFileWithTL.log")};verbosity=diagnostic -tl:on", out bool success);
737
RunnerUtilities.ExecMSBuild($"{projectFile.Path} /m /bl:{logFileWithoutTL} -flp:logfile={Path.Combine(logFolder.
Path
, "logFileWithoutTL.log")};verbosity=diagnostic", out success);
TestAssemblyInfo.cs (1)
73
_testEnvironment.SetTempPath(assemblyTempFolder.
Path
);
XMake_Tests.cs (5)
1258
string directory = _env.DefaultTestDirectory.
Path
;
1286
env.SetCurrentDirectory(folder.
Path
);
1481
var msbuildParameters = "\"" + directory.
Path
+ "\"";
1525
output.ShouldContain($"[A={directory.
Path
}{Path.DirectorySeparatorChar}]");
2534
string binLogLocation = _env.DefaultTestDirectory.
Path
;
Microsoft.Build.Engine.OM.UnitTests (3)
Construction\ConstructionEditing_Tests.cs (1)
3211
var testSdkRoot = env.CreateFolder().
Path
;
Definition\ProjectItem_Tests.cs (1)
454
IList<ProjectItem> items = ObjectModelHelpers.GetItemsFromFragment(itemDefinition.Replace("somedir", directory.
Path
), allItems: false, ignoreCondition: true);
TestAssemblyInfo.cs (1)
73
_testEnvironment.SetTempPath(assemblyTempFolder.
Path
);
Microsoft.Build.Engine.UnitTests (118)
BackEnd\BuildRequestConfiguration_Tests.cs (1)
566
project.FullPath = _env.CreateFolder().
Path
;
BackEnd\IntrinsicTask_Tests.cs (2)
2526
env.SetCurrentDirectory(projectDirectory.
Path
);
2536
<i1 Remove='" + projectDirectory.
Path
+ Path.DirectorySeparatorChar + @"*.tmp'/>
BackEnd\SdkResolverLoader_Tests.cs (8)
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
;
BackEnd\SdkResultOutOfProc_Tests.cs (2)
118
string projectFolder = _env.CreateFolder().
Path
;
153
string projectFolder = _env.CreateFolder().
Path
;
BackEnd\TaskExecutionHost_Tests.cs (1)
1066
env.SetEnvironmentVariable("MSBUILDDEBUGPATH", debugFolder.
Path
);
BinaryLogger_Tests.cs (12)
359
RunnerUtilities.ExecMSBuild($"{_logFile} -flp:logfile={Path.Combine(logFolder.
Path
, "logFile.log")};verbosity=diagnostic", out success);
362
string text = File.ReadAllText(Path.Combine(logFolder.
Path
, "logFile.log"));
416
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);
421
string text = File.ReadAllText(Path.Combine(logFolder.
Path
, "logFile.log"));
425
string text2 = File.ReadAllText(Path.Combine(logFolder.
Path
, "logFile2.log"));
428
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);
430
text = File.ReadAllText(Path.Combine(logFolder.
Path
, "logFile3.log"));
434
text2 = File.ReadAllText(Path.Combine(logFolder.
Path
, "logFile4.log"));
479
string symlinkPath = Path.Combine(testFolder2.
Path
, symlinkName);
480
string symlinkLvl2Path = Path.Combine(testFolder2.
Path
, symlinkLvl2Name);
Construction\SolutionFile_OldParser_Tests.cs (3)
774
env.CreateFolder(Path.Combine(solutionFolder.
Path
, "RelativePath"));
777
p.FullPath = Path.Combine(solutionFolder.
Path
, "RelativePath", "project file");
778
p.SolutionFileDirectory = Path.GetFullPath(solutionFolder.
Path
);
Construction\SolutionFilter_Tests.cs (5)
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);
Construction\SolutionProjectGenerator_Tests.cs (6)
92
TransientTestFolder classLibFolder = testEnvironment.CreateFolder(Path.Combine(folder.
Path
, "classlib"), createFolder: true);
102
TransientTestFolder simpleProjectFolder = testEnvironment.CreateFolder(Path.Combine(folder.
Path
, "simpleProject"), createFolder: true);
137
TransientTestFolder classLibFolder = testEnvironment.CreateFolder(Path.Combine(folder.
Path
, "classlib"), createFolder: true);
153
TransientTestFolder simpleProjectFolder = testEnvironment.CreateFolder(Path.Combine(folder.
Path
, "simpleProject"), createFolder: true);
213
TransientTestFolder classLibFolder = testEnvironment.CreateFolder(Path.Combine(folder.
Path
, "classlib"), createFolder: true);
229
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)
4803
includes.ShouldContain(root.
Path
);
4804
includes.ShouldContain(alpha.
Path
);
4805
includes.ShouldContain(beta.
Path
);
4806
includes.ShouldNotContain(gamma.
Path
);
4847
includes.ShouldContain(root.
Path
);
4848
includes.ShouldContain(alpha.
Path
);
4849
includes.ShouldContain(beta.
Path
);
4850
includes.ShouldContain(gamma.
Path
);
Evaluation\Preprocessor_Tests.cs (4)
850
string testSdkDirectory = env.CreateFolder().
Path
;
940
string testDirectory = env.CreateFolder().
Path
;
1055
string sdk1 = env.CreateFolder().
Path
;
1056
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)
40
_testFolder = _env.CreateFolder().
Path
;
FileMatcher_Tests.cs (11)
66
File.WriteAllBytes(Path.Combine(testFolder.
Path
, file), new byte[1]);
69
string[] fileMatches = FileMatcher.Default.GetFiles(testFolder.
Path
, pattern).FileList;
80
TransientTestFolder tf2 = _env.CreateFolder(Path.Combine(testFolder.
Path
, "subfolder"));
81
string symlinkPath = Path.Combine(tf2.
Path
, "mySymlink");
84
Directory.CreateSymbolicLink(symlinkPath, testFolder.
Path
);
85
string[] fileMatches = FileMatcher.Default.GetFiles(testFolder.
Path
, "**").FileList;
105
foreach (string fullPath in GetFilesComplexGlobbingMatchingInfo.FilesToCreate.Select(i => Path.Combine(testFolder.
Path
, i.ToPlatformSlash())))
114
string[] matchedFiles = fileMatcher.GetFiles(testFolder.
Path
, include, excludes?.ToList()).FileList;
1224
string workingPath = _env.CreateFolder().
Path
;
1238
string workingPath = _env.CreateFolder().
Path
;
1255
string workingPath = _env.CreateFolder().
Path
;
Graph\GetCompatiblePlatformGraph_Tests.cs (6)
365
TransientTestFolder project1Folder = testEnvironment.CreateFolder(Path.Combine(folder.
Path
, firstProjectName), createFolder: true);
366
TransientTestFolder project1SubFolder = testEnvironment.CreateFolder(Path.Combine(project1Folder.
Path
, firstProjectName), createFolder: true);
380
TransientTestFolder project2Folder = testEnvironment.CreateFolder(Path.Combine(folder.
Path
, secondProjectName), createFolder: true);
381
TransientTestFolder project2SubFolder = testEnvironment.CreateFolder(Path.Combine(project2Folder.
Path
, secondProjectName), createFolder: true);
391
TransientTestFolder project3Folder = testEnvironment.CreateFolder(Path.Combine(folder.
Path
, thirdProjectName), createFolder: true);
392
TransientTestFolder project3SubFolder = testEnvironment.CreateFolder(Path.Combine(project3Folder.
Path
, thirdProjectName), createFolder: true);
Graph\ProjectGraph_Tests.cs (8)
843
string project1Path = Path.Combine(env.DefaultTestDirectory.
Path
, "Project1.csproj");
844
string project2Path = Path.Combine(env.DefaultTestDirectory.
Path
, "Project2.vcxproj");
845
string project3Path = Path.Combine(env.DefaultTestDirectory.
Path
, "Project3.vcxproj");
846
string project4Path = Path.Combine(env.DefaultTestDirectory.
Path
, "Project4.vcxproj");
847
string project5Path = Path.Combine(env.DefaultTestDirectory.
Path
, "Project5.vcxproj");
848
string project6Path = Path.Combine(env.DefaultTestDirectory.
Path
, "Project6.wapproj");
849
string project7Path = Path.Combine(env.DefaultTestDirectory.
Path
, "Project7.csproj");
850
string project8Path = Path.Combine(env.DefaultTestDirectory.
Path
, "Project8.csproj");
TestAssemblyInfo.cs (1)
73
_testEnvironment.SetTempPath(assemblyTempFolder.
Path
);
TypeLoader_Tests.cs (2)
104
string newAssemblyLocation = Path.Combine(folder.
Path
, Path.GetFileName(currentAssembly));
109
File.Copy(utilities, Path.Combine(folder.
Path
, utilitiesName));
Microsoft.Build.Framework.UnitTests (1)
TestAssemblyInfo.cs (1)
73
_testEnvironment.SetTempPath(assemblyTempFolder.
Path
);
Microsoft.Build.Tasks.UnitTests (92)
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)
176
DestinationFolder = new TaskItem(destinationFolder.
Path
),
218
SourceFolders = new ITaskItem[] { new TaskItem(s0Folder.
Path
), new TaskItem(s1Folder.
Path
) },
219
DestinationFolder = new TaskItem(destinationFolder.
Path
),
228
Directory.Exists(Path.Combine(destinationFolder.
Path
, "source0")).ShouldBeTrue();
229
Directory.Exists(Path.Combine(destinationFolder.
Path
, "source1")).ShouldBeTrue();
244
DestinationFolder = new TaskItem(destinationFolder.
Path
),
274
SourceFolders = new ITaskItem[] { new TaskItem(sourceFolder.
Path
) },
275
DestinationFolder = new TaskItem(destinationFolder.
Path
),
299
DestinationFolder = new TaskItem(destinationFolder.
Path
),
323
DestinationFolder = new TaskItem(destinationFolder.
Path
),
372
DestinationFolder = new TaskItem(destinationFolder.
Path
),
395
SourceFolders = new ITaskItem[] { new TaskItem(sourceFolder.
Path
) },
1104
var sourceFile = FileUtilities.GetTemporaryFile(env.DefaultTestDirectory.
Path
, null, "src", false);
1105
var destinationFile = FileUtilities.GetTemporaryFile(env.DefaultTestDirectory.
Path
, null, "dst", false);
2945
string destFile = Path.Combine(destFolder.
Path
, "The Destination");
CreateCSharpManifestResourceName_Tests.cs (1)
460
env.SetCurrentDirectory(env.DefaultTestDirectory.
Path
);
DownloadFile_Tests.cs (9)
37
DestinationFolder = new TaskItem(folder.
Path
),
66
DestinationFolder = new TaskItem(folder.
Path
),
77
FileInfo file = new FileInfo(Path.Combine(folder.
Path
, "foo.txt"));
114
DestinationFolder = new TaskItem(folder.
Path
),
122
FileInfo file = new FileInfo(Path.Combine(folder.
Path
, filename));
144
DestinationFolder = new TaskItem(folder.
Path
),
156
FileInfo file = new FileInfo(Path.Combine(folder.
Path
, filename));
209
DestinationFolder = new TaskItem(folder.
Path
),
322
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)
279
GetSDKReferenceFiles.SDKFilesCache cache = new(null, folder.
Path
, null, null, null);
281
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)
51
var folder = env.CreateFolder().
Path
;
RemoveDir_Tests.cs (1)
56
list.Add(new TaskItem(env.CreateFolder().
Path
));
ResourceHandling\GenerateResource_Tests.cs (2)
3669
env.SetCurrentDirectory(env.DefaultTestDirectory.
Path
);
3675
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 (2)
116
string output = RunnerUtilities.ExecMSBuild(assemblyProj.Path + $" /p:OutDir={Path.Combine(folder.
Path
, "subFolder")} /restore", out bool success);
124
<Reference Include=""{Path.Combine(folder.
Path
, "subFolder", "5106.dll")}"" />
TestAssemblyInfo.cs (1)
73
_testEnvironment.SetTempPath(assemblyTempFolder.
Path
);
Unzip_Tests.cs (34)
40
DestinationFolder = new TaskItem(source.
Path
),
68
DestinationFolder = new TaskItem(destination.
Path
),
81
DestinationFolder = new TaskItem(destination.
Path
),
89
_mockEngine.Log.ShouldContain(Path.Combine(destination.
Path
, "BE78A17D30144B549D21F71D5C633F7D.txt"), customMessage: _mockEngine.Log);
90
_mockEngine.Log.ShouldContain(Path.Combine(destination.
Path
, "A04FF4B88DF14860B7C73A8E75A4FB76.txt"), customMessage: _mockEngine.Log);
96
DestinationFolder = new TaskItem(destination.
Path
),
125
DestinationFolder = new TaskItem(destination.
Path
),
133
_mockEngine.Log.ShouldContain(Path.Combine(destination.
Path
, "BE78A17D30144B549D21F71D5C633F7D.txt"), customMessage: _mockEngine.Log);
134
_mockEngine.Log.ShouldContain(Path.Combine(destination.
Path
, "A04FF4B88DF14860B7C73A8E75A4FB76.txt"), customMessage: _mockEngine.Log);
135
_mockEngine.Log.ShouldContain(Path.Combine(destination.
Path
, "subdir", "F83E9633685494E53BEF3794EDEEE6A6.txt"), customMessage: _mockEngine.Log);
136
_mockEngine.Log.ShouldContain(Path.Combine(destination.
Path
, "subdir", "21D6D4596067723B3AC5DF9A8B3CBFE7.txt"), customMessage: _mockEngine.Log);
137
Directory.Exists(Path.Combine(destination.
Path
, "emptyDir"));
193
DestinationFolder = new TaskItem(source.
Path
),
217
DestinationFolder = new TaskItem(folder.
Path
),
237
DestinationFolder = new TaskItem(folder.
Path
),
238
SourceFiles = new ITaskItem[] { new TaskItem(Path.Combine(testEnvironment.DefaultTestDirectory.
Path
, "foo.zip")), }
262
DestinationFolder = new TaskItem(destination.
Path
),
271
_mockEngine.Log.ShouldContain(Path.Combine(destination.
Path
, "BE78A17D30144B549D21F71D5C633F7D.txt"), customMessage: _mockEngine.Log);
272
_mockEngine.Log.ShouldNotContain(Path.Combine(destination.
Path
, "A04FF4B88DF14860B7C73A8E75A4FB76.txt"), customMessage: _mockEngine.Log);
291
DestinationFolder = new TaskItem(destination.
Path
),
300
_mockEngine.Log.ShouldNotContain(Path.Combine(destination.
Path
, "BE78A17D30144B549D21F71D5C633F7D.txt"), customMessage: _mockEngine.Log);
301
_mockEngine.Log.ShouldContain(Path.Combine(destination.
Path
, "A04FF4B88DF14860B7C73A8E75A4FB76.txt"), customMessage: _mockEngine.Log);
324
DestinationFolder = new TaskItem(destination.
Path
),
334
_mockEngine.Log.ShouldContain(Path.Combine(destination.
Path
, "file1.js"), customMessage: _mockEngine.Log);
335
_mockEngine.Log.ShouldNotContain(Path.Combine(destination.
Path
, "file1.js.map"), customMessage: _mockEngine.Log);
336
_mockEngine.Log.ShouldContain(Path.Combine(destination.
Path
, "file2.js"), customMessage: _mockEngine.Log);
337
_mockEngine.Log.ShouldNotContain(Path.Combine(destination.
Path
, "readme.txt"), customMessage: _mockEngine.Log);
338
_mockEngine.Log.ShouldNotContain(Path.Combine(destination.
Path
, "sub", "subfile.js"), customMessage: _mockEngine.Log);
357
DestinationFolder = new TaskItem(destination.
Path
),
385
DestinationFolder = new TaskItem(destination.
Path
),
413
DestinationFolder = new TaskItem(destination.
Path
),
441
DestinationFolder = new TaskItem(destination.
Path
),
475
DestinationFolder = new TaskItem(destination.
Path
),
481
string unzippedFilePath = Path.Combine(destination.
Path
, executableName);
WriteCodeFragment_Tests.cs (3)
105
TaskItem folder = new TaskItem(env.CreateFolder(folderPath: null, createFolder: false).
Path
);
128
TaskItem file = new TaskItem(Path.Combine(env.CreateFolder(folderPath: null, createFolder: false).
Path
, "File.tmp"));
397
TaskItem folder = new TaskItem(env.CreateFolder(folderPath: null, createFolder: false).
Path
);
WriteLinesToFile_Tests.cs (3)
301
var file = Path.Combine(directory.
Path
, $"{Guid.NewGuid().ToString("N")}.tmp");
311
Directory.Exists(directory.
Path
).ShouldBeFalse();
315
Directory.Exists(directory.
Path
).ShouldBeTrue();
ZipDirectory_Tests.cs (6)
32
string zipFilePath = Path.Combine(testEnvironment.CreateFolder(createFolder: true).
Path
, "test.zip");
38
SourceDirectory = new TaskItem(sourceFolder.
Path
)
43
_mockEngine.Log.ShouldContain(sourceFolder.
Path
, customMessage: _mockEngine.Log);
80
SourceDirectory = new TaskItem(sourceFolder.
Path
)
85
_mockEngine.Log.ShouldContain(sourceFolder.
Path
, customMessage: _mockEngine.Log);
118
SourceDirectory = new TaskItem(folder.
Path
)
Microsoft.Build.UnitTests.Shared (20)
EngineTestEnvironment.cs (1)
113
public string TestRoot => _folder.
Path
;
TestEnvironment.cs (19)
183
return SetTempPath(folder.
Path
, true);
192
return WithTransientTestState(SetTempPath(folder.
Path
, true));
223
return WithTransientTestState(new TransientTestFile(transientTestFolder.
Path
, fileName, contents));
234
return WithTransientTestState(new TransientTestFile(transientTestFolder.
Path
, extension,
257
return WithTransientTestState(new TransientTestFile(transientTestFolder.
Path
, extension,
290
Assert.True(!(createFolder ^ FileSystems.Default.DirectoryExists(folder.
Path
)));
734
Directory.CreateDirectory(
Path
);
740
return new TransientTestFolder(System.IO.Path.Combine(
Path
, directoryName));
745
return new TransientTestFile(
Path
, fileName, contents);
754
Path
.ShouldNotBeNullOrEmpty();
755
Path
.ShouldNotBe(@"\");
756
Path
.ShouldNotBe(@"/");
757
System.IO.Path.GetFullPath(
Path
).ShouldNotBe(System.IO.Path.GetFullPath(System.IO.Path.GetTempPath()));
758
System.IO.Path.IsPathRooted(
Path
).ShouldBeTrue($"{
Path
} is not rooted");
760
FileUtilities.DeleteDirectoryNoThrow(
Path
, true);
809
Directory.CreateDirectory(destination.
Path
);
811
string path = System.IO.Path.Combine(destination.
Path
, filename);
813
ZipFile.CreateFromDirectory(source.
Path
, path);
Microsoft.Build.Utilities.UnitTests (14)
TestAssemblyInfo.cs (1)
73
_testEnvironment.SetTempPath(assemblyTempFolder.
Path
);
ToolLocationHelper_Tests.cs (12)
2504
string rootDir = Path.Combine(env.DefaultTestDirectory.
Path
, "framework-root");
2533
string customFrameworkRootPath = Path.Combine(env.DefaultTestDirectory.
Path
, "framework-root");
2556
string rootDir = Path.Combine(env.CreateFolder().
Path
, "framework-root");
2557
string fallbackPath = Path.Combine(env.CreateFolder().
Path
, "framework-root");
2587
string customFrameworkDirToUse = Path.Combine(env.CreateFolder().
Path
, "framework-root");
2600
string customFrameworkDirToUse = Path.Combine(env.CreateFolder().
Path
, "framework-root");
2602
string rootDir = env.CreateFolder().
Path
;
2617
string customFrameworkDirToUse = Path.Combine(env.CreateFolder().
Path
, "framework-root");
2634
string customFrameworkDirToUse = Path.Combine(env.CreateFolder().
Path
, "framework-root");
2649
string customFrameworkDirToUse = Path.Combine(env.CreateFolder().
Path
, "framework-root");
2651
string rootDir = env.CreateFolder().
Path
;
2666
string customFrameworkDirToUse = Path.Combine(env.CreateFolder().
Path
, "framework-root");
ToolTask_Tests.cs (1)
659
string tempDirectory = env.CreateFolder().
Path
;