1 write to Path
Microsoft.NET.TestFramework (1)
1951 references to Path
ArgumentForwarding.Tests (1)
containerize.UnitTests (1)
dotnet.Tests (1144)
CommandTests\Pack\PackTests.cs (39)
23.WithWorkingDirectory(testInstance.Path);
29var outputDir = new DirectoryInfo(Path.Combine(testInstance.Path, "bin", "Test"));
44var outputDir = new DirectoryInfo(Path.Combine(testInstance.Path, "bin2"));
47.WithWorkingDirectory(testInstance.Path)
65.WithWorkingDirectory(testInstance.Path)
69var output = new FileInfo(Path.Combine(testInstance.Path,
78var outputPackage = new FileInfo(Path.Combine(testInstance.Path,
92.WithWorkingDirectory(testInstance.Path)
96var outputPackage = new FileInfo(Path.Combine(testInstance.Path,
115.WithWorkingDirectory(testInstance.Path)
120var outputPackage = new FileInfo(Path.Combine(testInstance.Path,
130var symbolsPackage = new FileInfo(Path.Combine(testInstance.Path,
151.WithWorkingDirectory(testInstance.Path)
163.WithWorkingDirectory(testInstance.Path)
175.WithWorkingDirectory(testInstance.Path)
193.WithWorkingDirectory(testInstance.Path)
206.WithWorkingDirectory(testInstance.Path);
212var outputDir = new DirectoryInfo(Path.Combine(testInstance.Path, "bin", "Debug"));
235var rootPath = Path.Combine(_testAssetsManager.CreateTestDirectory().Path, "TestProject");
270.WithWorkingDirectory(testInstance.Path)
288.WithWorkingDirectory(testInstance.Path)
300string nuspecPath = Path.Combine(testInstance.Path, "PackNoCsproj.nuspec");
302.WithWorkingDirectory(testInstance.Path)
308var outputDir = new DirectoryInfo(testInstance.Path);
312var nupkgPath = Path.Combine(testInstance.Path, "PackNoCsproj.1.2.3.nupkg");
329string nuspecPath = Path.Combine(testInstance.Path, "PackNoCsproj.nuspec");
331.WithWorkingDirectory(testInstance.Path)
344string nuspecPath = Path.Combine(testInstance.Path, "PackNoCsproj.nuspec");
347.WithWorkingDirectory(testInstance.Path)
355var nupkgPath = Path.Combine(testInstance.Path, "CustomID.1.0.0.nupkg");
375string nuspecPath = Path.Combine(testInstance.Path, "TestingPackWithConfig.nuspec");
377var configDir = Path.Combine(testInstance.Path, "bin", configuration);
382.WithWorkingDirectory(testInstance.Path)
386var outputPackage = new FileInfo(Path.Combine(testInstance.Path, "TestPackWithConfig.1.0.0.nupkg"));
402string nuspecPath = Path.Combine(testInstance.Path, "PackNoCsproj.nuspec");
403string outputDirPath = Path.Combine(testInstance.Path, "output");
406.WithWorkingDirectory(testInstance.Path)
426string nuspecPath = Path.Combine(testInstance.Path, "NonExistent.nuspec");
429.WithWorkingDirectory(testInstance.Path)
CommandTests\Package\Add\GivenDotnetPackageAdd.cs (38)
22.Path;
118.Path;
135.Path;
157.Path;
184.Path;
205.Path;
227.Path;
246.Path;
261.Path;
277.Path;
326var file = Path.Join(testInstance.Path, "Program.cs");
332.WithWorkingDirectory(testInstance.Path)
351var file = Path.Join(testInstance.Path, "Program.cs");
358.WithWorkingDirectory(testInstance.Path)
377var file = Path.Join(testInstance.Path, "Program.cs");
385.WithWorkingDirectory(testInstance.Path)
414var file = Path.Join(testInstance.Path, "Program.cs");
422.WithWorkingDirectory(testInstance.Path)
439var file = Path.Join(testInstance.Path, "Program.cs");
445.WithWorkingDirectory(testInstance.Path)
462var file = Path.Join(testInstance.Path, "Program.cs");
469.WithWorkingDirectory(testInstance.Path)
483var file = Path.Join(testInstance.Path, "Program.cs");
490.WithWorkingDirectory(testInstance.Path)
503var file = Path.Join(testInstance.Path, "Program.cs");
509.WithWorkingDirectory(testInstance.Path)
526var file = Path.Join(testInstance.Path, "Program.cs");
532var directoryPackagesProps = Path.Join(testInstance.Path, "Directory.Packages.props");
542.WithWorkingDirectory(testInstance.Path)
570var file = Path.Join(testInstance.Path, "Program.cs");
586var directoryPackagesProps = Path.Join(testInstance.Path, "Directory.Packages.props");
599.WithWorkingDirectory(testInstance.Path)
633var file = Path.Join(testInstance.Path, "Program.cs");
640var directoryPackagesProps = Path.Join(testInstance.Path, "Directory.Packages.props");
650.WithWorkingDirectory(testInstance.Path)
677var file = Path.Join(testInstance.Path, "Program.cs");
684var directoryPackagesProps = Path.Join(testInstance.Path, "Directory.Packages.props");
698.WithWorkingDirectory(testInstance.Path)
CommandTests\Project\Convert\DotnetProjectConvertTests.cs (130)
26var dotnetProjectConvert = Path.Join(testInstance.Path, "dotnetProjectConvert");
49var dotnetNewConsole = Path.Join(testInstance.Path, "DotnetNewConsole");
86var libraryDirFullPath = Path.Join(testInstance.Path, libraryDir);
105var fileDirFullPath = Path.Join(testInstance.Path, fileDir);
120var outputDirFullPath = Path.Join(testInstance.Path, outputDir);
143var libraryDirFullPath = Path.Join(testInstance.Path, "Lib");
162var fileDirFullPath = Path.Join(testInstance.Path, "File");
177var outputDirFullPath = Path.Join(testInstance.Path, "File/Project");
199var directoryPath = Path.Join(testInstance.Path, "MyApp");
201File.WriteAllText(Path.Join(testInstance.Path, "MyApp.cs"), "Console.WriteLine();");
204.WithWorkingDirectory(testInstance.Path)
209new DirectoryInfo(testInstance.Path)
218Directory.CreateDirectory(Path.Join(testInstance.Path, "MyApp"));
219File.WriteAllText(Path.Join(testInstance.Path, "MyApp.cs"), "Console.WriteLine();");
222.WithWorkingDirectory(testInstance.Path)
226new DirectoryInfo(testInstance.Path)
230new DirectoryInfo(Path.Join(testInstance.Path, "MyApp"))
233new DirectoryInfo(Path.Join(testInstance.Path, "MyApp1"))
242var directoryPath = Path.Join(testInstance.Path, "SomeOutput");
244File.WriteAllText(Path.Join(testInstance.Path, "MyApp.cs"), "Console.WriteLine();");
247.WithWorkingDirectory(testInstance.Path)
252new DirectoryInfo(testInstance.Path)
261File.WriteAllText(Path.Join(testInstance.Path, "Program1.cs"), "Console.WriteLine(1);");
262File.WriteAllText(Path.Join(testInstance.Path, "Program2.cs"), "Console.WriteLine(2);");
265.WithWorkingDirectory(testInstance.Path)
269new DirectoryInfo(testInstance.Path)
273new DirectoryInfo(Path.Join(testInstance.Path, "Program1"))
284.WithWorkingDirectory(testInstance.Path)
289new DirectoryInfo(testInstance.Path)
299.WithWorkingDirectory(testInstance.Path)
302.And.HaveStdErrContaining(string.Format(CliCommandStrings.InvalidFilePath, Path.Join(testInstance.Path, "NotHere.cs")));
304new DirectoryInfo(testInstance.Path)
312var filePath = Path.Join(testInstance.Path, "Program.vb");
316.WithWorkingDirectory(testInstance.Path)
321new DirectoryInfo(testInstance.Path)
330File.WriteAllText(Path.Join(testInstance.Path, "Program.CS"), "Console.WriteLine();");
333.WithWorkingDirectory(testInstance.Path)
337new DirectoryInfo(testInstance.Path)
341new DirectoryInfo(Path.Join(testInstance.Path, "Program"))
352File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), content);
355.WithWorkingDirectory(testInstance.Path)
359new DirectoryInfo(testInstance.Path)
363File.ReadAllText(Path.Join(testInstance.Path, "Program.cs"))
366new DirectoryInfo(Path.Join(testInstance.Path, "Program"))
370File.ReadAllText(Path.Join(testInstance.Path, "Program", "Program.cs"))
378var appDirectory = Path.Join(testInstance.Path, "app");
383.WithWorkingDirectory(testInstance.Path)
387new DirectoryInfo(Path.Join(testInstance.Path, "app"))
391new DirectoryInfo(Path.Join(testInstance.Path, "app", "Program"))
403File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """
406File.WriteAllText(Path.Join(testInstance.Path, "my.json"), "");
407File.WriteAllText(Path.Join(testInstance.Path, "Resources.resx"), "");
408File.WriteAllText(Path.Join(testInstance.Path, "Util.cs"), "");
409Directory.CreateDirectory(Path.Join(testInstance.Path, "subdir"));
410File.WriteAllText(Path.Join(testInstance.Path, "subdir", "second.json"), "");
413.WithWorkingDirectory(testInstance.Path)
417new DirectoryInfo(testInstance.Path)
421new DirectoryInfo(Path.Join(testInstance.Path, "Program"))
425new DirectoryInfo(Path.Join(testInstance.Path, "Program", "subdir"))
434File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """
438File.WriteAllText(Path.Join(testInstance.Path, "my.json"), "");
439File.WriteAllText(Path.Join(testInstance.Path, "Resources.resx"), "");
440File.WriteAllText(Path.Join(testInstance.Path, "Util.cs"), "");
443.WithWorkingDirectory(testInstance.Path)
447new DirectoryInfo(testInstance.Path)
451new DirectoryInfo(Path.Join(testInstance.Path, "Program"))
460File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """
464File.WriteAllText(Path.Join(testInstance.Path, "my.json"), "");
465File.WriteAllText(Path.Join(testInstance.Path, "Resources.resx"), "");
466File.WriteAllText(Path.Join(testInstance.Path, "Util.cs"), "");
469.WithWorkingDirectory(testInstance.Path)
473new DirectoryInfo(testInstance.Path)
477new DirectoryInfo(Path.Join(testInstance.Path, "Program"))
489File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """
492File.WriteAllText(Path.Join(testInstance.Path, "my.json"), "");
493File.WriteAllText(Path.Join(testInstance.Path, "Resources.resx"), "");
494File.WriteAllText(Path.Join(testInstance.Path, "Util.cs"), "");
495File.WriteAllText(Path.Join(testInstance.Path, "second.json"), "");
497File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.targets"), """
506.WithWorkingDirectory(testInstance.Path)
510new DirectoryInfo(testInstance.Path)
515new DirectoryInfo(Path.Join(testInstance.Path, "Program"))
524File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """
527File.WriteAllText(Path.Join(testInstance.Path, "Util.cs"), """
530File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), """
541.WithWorkingDirectory(testInstance.Path)
548.WithWorkingDirectory(testInstance.Path)
552new DirectoryInfo(testInstance.Path)
557new DirectoryInfo(Path.Join(testInstance.Path, "Program"))
563.WithWorkingDirectory(testInstance.Path)
573var subdir = Path.Join(testInstance.Path, "subdir");
581File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), """
623var subdir = Path.Join(testInstance.Path, "subdir");
628File.WriteAllText(Path.Join(testInstance.Path, "Util.cs"), """
631File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), """
679File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """
682File.WriteAllText(Path.Join(testInstance.Path, "my.json"), "");
683File.WriteAllText(Path.Join(testInstance.Path, "Resources.resx"), "");
684File.WriteAllText(Path.Join(testInstance.Path, "Util.cs"), "");
685File.WriteAllText(Path.Join(testInstance.Path, $"repo.{ext}"), "");
688.WithWorkingDirectory(testInstance.Path)
692new DirectoryInfo(testInstance.Path)
696new DirectoryInfo(Path.Join(testInstance.Path, "Program"))
711var filePath = Path.Join(testInstance.Path, "Program.cs");
715.WithWorkingDirectory(testInstance.Path)
720new DirectoryInfo(Path.Join(testInstance.Path))
732var filePath = Path.Join(testInstance.Path, "Program.cs");
736.WithWorkingDirectory(testInstance.Path)
742new DirectoryInfo(Path.Join(testInstance.Path))
757File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), originalSource);
760.WithWorkingDirectory(testInstance.Path)
764new DirectoryInfo(testInstance.Path)
768File.ReadAllText(Path.Join(testInstance.Path, "Program.cs"))
771new DirectoryInfo(Path.Join(testInstance.Path, "Program"))
775File.ReadAllText(Path.Join(testInstance.Path, "Program", "Program.cs"))
778File.ReadAllText(Path.Join(testInstance.Path, "Program", "Program.csproj"))
805File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """
812File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), """
822.WithWorkingDirectory(testInstance.Path)
826File.ReadAllText(Path.Join(testInstance.Path, "Program", "Program.csproj"))
850File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """
853File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), """
862.WithWorkingDirectory(testInstance.Path)
866File.ReadAllText(Path.Join(testInstance.Path, "Program", "Program.csproj"))
890File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), $"""
897File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), $"""
907.WithWorkingDirectory(testInstance.Path)
911File.ReadAllText(Path.Join(testInstance.Path, "Program", "Program.csproj"))
1046var libDir = Path.Join(testInstance.Path, "lib");
1052filePath: Path.Join(testInstance.Path, "app", "Program.cs"),
CommandTests\Run\GivenThatWeCanPassNonProjectFilesToDotnetRun.cs (1)
20.Path;
CommandTests\Run\RunFileTests.cs (404)
153var programPath = Path.Join(testInstance.Path, "Program.cs");
160.WithWorkingDirectory(testInstance.Path)
173testInstance.Path,
185File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program);
188.WithWorkingDirectory(testInstance.Path)
195File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), $"""
206.WithWorkingDirectory(testInstance.Path)
212.WithWorkingDirectory(testInstance.Path)
218.WithWorkingDirectory(testInstance.Path)
223new DotnetCommand(Log, Path.Join(testInstance.Path, "Program.cs"))
224.WithWorkingDirectory(testInstance.Path)
230.WithWorkingDirectory(testInstance.Path)
238.WithWorkingDirectory(testInstance.Path)
248.WithWorkingDirectory(testInstance.Path)
258.WithWorkingDirectory(testInstance.Path)
275File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program);
278.WithWorkingDirectory(testInstance.Path)
291testInstance.Path,
303File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program);
305var dirName = Path.GetFileName(testInstance.Path);
308.WithWorkingDirectory(Path.GetDirectoryName(testInstance.Path)!)
321File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program);
324.WithWorkingDirectory(testInstance.Path)
341File.WriteAllText(Path.Join(testInstance.Path, cmd), """
345File.WriteAllText(Path.Join(testInstance.Path, $"dotnet-{cmd}"), """
352.WithWorkingDirectory(testInstance.Path)
367.WithWorkingDirectory(testInstance.Path)
374.WithWorkingDirectory(testInstance.Path)
389File.WriteAllText(Path.Join(testInstance.Path, "test.dll"), """
396.WithWorkingDirectory(testInstance.Path)
404.WithWorkingDirectory(testInstance.Path)
416File.WriteAllText(Path.Join(testInstance.Path, "complog"), """
422.WithWorkingDirectory(testInstance.Path)
427.WithWorkingDirectory(testInstance.Path)
433.WithWorkingDirectory(testInstance.Path)
440.WithWorkingDirectory(testInstance.Path)
447.WithWorkingDirectory(testInstance.Path)
499.WithWorkingDirectory(testInstance.Path)
503.And.HaveStdErrContaining(string.Format(CliCommandStrings.RunCommandExceptionNoProjects, testInstance.Path, RunCommandParser.ProjectOption.Name));
517File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program);
519path ??= testInstance.Path;
522.WithWorkingDirectory(testInstance.Path)
527testInstance.Path,
538File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program);
541.WithWorkingDirectory(testInstance.Path)
546testInstance.Path,
558File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program);
559File.WriteAllText(Path.Join(testInstance.Path, "App.csproj"), s_consoleProject);
562.WithWorkingDirectory(testInstance.Path)
575Directory.CreateDirectory(Path.Join(testInstance.Path, "file"));
576File.WriteAllText(Path.Join(testInstance.Path, "file", "Program.cs"), s_program);
577Directory.CreateDirectory(Path.Join(testInstance.Path, "proj"));
578File.WriteAllText(Path.Join(testInstance.Path, "proj", "App.csproj"), s_consoleProject);
581.WithWorkingDirectory(Path.Join(testInstance.Path, "proj"))
593Directory.CreateDirectory(Path.Join(testInstance.Path, "file"));
594File.WriteAllText(Path.Join(testInstance.Path, "file", "Program.cs"), s_program);
595Directory.CreateDirectory(Path.Join(testInstance.Path, "proj"));
596File.WriteAllText(Path.Join(testInstance.Path, "proj", "App.csproj"), s_consoleProject);
599.WithWorkingDirectory(Path.Join(testInstance.Path, "proj"))
618File.WriteAllText(Path.Join(testInstance.Path, fileName), """
624.WithWorkingDirectory(testInstance.Path)
641File.WriteAllText(Path.Join(testInstance.Path, fileName), s_program);
644.WithWorkingDirectory(testInstance.Path)
649testInstance.Path,
657File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program);
658File.WriteAllText(Path.Join(testInstance.Path, "Program2.cs"), s_program);
661.WithWorkingDirectory(testInstance.Path)
667.WithWorkingDirectory(testInstance.Path)
682.WithWorkingDirectory(testInstance.Path)
687testInstance.Path,
698File.WriteAllText(Path.Join(testInstance.Path, "Util.cs"), s_util);
701.WithWorkingDirectory(testInstance.Path)
714File.WriteAllText(Path.Join(testInstance.Path, "Util.cs"), s_util);
717.WithWorkingDirectory(testInstance.Path)
722testInstance.Path,
733File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_programDependingOnUtil);
734File.WriteAllText(Path.Join(testInstance.Path, "Util.cs"), s_util);
737.WithWorkingDirectory(testInstance.Path)
743File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), $"""
749.WithWorkingDirectory(testInstance.Path)
764File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_programDependingOnUtil);
765File.WriteAllText(Path.Join(testInstance.Path, "Util.cs"), s_util);
768.WithWorkingDirectory(testInstance.Path)
790File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program);
791Directory.CreateDirectory(Path.Join(testInstance.Path, "nested"));
792File.WriteAllText(Path.Join(testInstance.Path, "nested", "App.csproj"), s_consoleProject);
795.WithWorkingDirectory(testInstance.Path)
809File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program);
810File.WriteAllText(Path.Join(testInstance.Path, "App.csproj"), s_consoleProject);
812var dirName = Path.GetFileName(testInstance.Path);
814var workDir = Path.GetDirectoryName(testInstance.Path)!;
833File.Delete(Path.Join(testInstance.Path, "MSBuildTestApp.csproj"));
836.WithWorkingDirectory(testInstance.Path)
849File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), string.Empty);
852.WithWorkingDirectory(testInstance.Path)
865File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program);
866File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), """
875.WithWorkingDirectory(testInstance.Path)
888File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """
891File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), """
900.WithWorkingDirectory(testInstance.Path)
909.WithWorkingDirectory(testInstance.Path)
914.WithWorkingDirectory(Path.Join(testInstance.Path, "Program"))
929var sdkDir = Path.Join(testInstance.Path, "MySdk");
959var appDir = Path.Join(testInstance.Path, "app");
976var packagesDir = Path.Join(testInstance.Path, ".packages");
1007File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program);
1008File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.targets"), """
1019.WithWorkingDirectory(testInstance.Path)
1032File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program);
1033File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.targets"), """
1042.WithWorkingDirectory(testInstance.Path)
1062File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program);
1065.WithWorkingDirectory(testInstance.Path)
1081File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program);
1084.WithWorkingDirectory(testInstance.Path)
1089testInstance.Path,
1100File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program);
1107.WithWorkingDirectory(testInstance.Path)
1124File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program);
1131.WithWorkingDirectory(testInstance.Path)
1136new DirectoryInfo(testInstance.Path)
1146File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program);
1153.WithWorkingDirectory(testInstance.Path)
1157new DirectoryInfo(testInstance.Path)
1175File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program);
1178.WithWorkingDirectory(testInstance.Path)
1185new DirectoryInfo(testInstance.Path)
1195File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program);
1198.WithWorkingDirectory(testInstance.Path)
1206new DirectoryInfo(testInstance.Path)
1216File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program);
1219.WithWorkingDirectory(testInstance.Path)
1224new DirectoryInfo(testInstance.Path)
1237File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program);
1240.WithWorkingDirectory(testInstance.Path)
1245new DirectoryInfo(testInstance.Path)
1258File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program);
1261.WithWorkingDirectory(testInstance.Path)
1266string binaryLogPath = Path.Join(testInstance.Path, "msbuild.binlog");
1281var programFile = Path.Join(testInstance.Path, "Program.cs");
1285.WithWorkingDirectory(testInstance.Path)
1306var programFile = Path.Join(testInstance.Path, "Program.cs");
1310.WithWorkingDirectory(testInstance.Path)
1323var programFile = Path.Join(testInstance.Path, "Program.cs");
1327.WithWorkingDirectory(testInstance.Path)
1339File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """
1345.WithWorkingDirectory(testInstance.Path)
1352File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """
1357.WithWorkingDirectory(testInstance.Path)
1372File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_programReadingEmbeddedResource);
1373File.WriteAllText(Path.Join(testInstance.Path, "Resources.resx"), s_resx);
1376.WithWorkingDirectory(testInstance.Path)
1384File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), $"""
1390.WithWorkingDirectory(testInstance.Path)
1408File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_programReadingEmbeddedResource);
1409File.WriteAllText(Path.Join(testInstance.Path, "Resources.resx"), s_resx);
1410File.WriteAllText(Path.Join(testInstance.Path, $"repo.{ext}"), "");
1415.WithWorkingDirectory(testInstance.Path)
1425var programFile = Path.Join(testInstance.Path, "Program.cs");
1434.WithWorkingDirectory(testInstance.Path)
1441.WithWorkingDirectory(testInstance.Path)
1447.WithWorkingDirectory(testInstance.Path)
1457var programFile = Path.Join(testInstance.Path, "Program.cs");
1466.WithWorkingDirectory(testInstance.Path)
1473.WithWorkingDirectory(testInstance.Path)
1479.WithWorkingDirectory(testInstance.Path)
1484.WithWorkingDirectory(testInstance.Path)
1494File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), """
1501var programFile = Path.Join(testInstance.Path, "Program.cs");
1509.WithWorkingDirectory(testInstance.Path)
1518var programFile = Path.Join(testInstance.Path, "Program.cs");
1529.WithWorkingDirectory(testInstance.Path)
1539var programFile = Path.Join(testInstance.Path, "Program.cs");
1548.WithWorkingDirectory(testInstance.Path)
1555.WithWorkingDirectory(testInstance.Path)
1562.WithWorkingDirectory(testInstance.Path)
1569.WithWorkingDirectory(testInstance.Path)
1579var programFile = Path.Join(testInstance.Path, "Program.cs");
1588.WithWorkingDirectory(testInstance.Path)
1595.WithWorkingDirectory(testInstance.Path)
1603.WithWorkingDirectory(testInstance.Path)
1610.WithWorkingDirectory(testInstance.Path)
1620var programFile = Path.Join(testInstance.Path, "lib.cs");
1630.WithWorkingDirectory(testInstance.Path)
1635.WithWorkingDirectory(testInstance.Path)
1648var programFile = Path.Join(testInstance.Path, "lib.cs");
1658File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), """
1670.WithWorkingDirectory(testInstance.Path)
1675.WithWorkingDirectory(testInstance.Path)
1681.WithWorkingDirectory(testInstance.Path)
1694var programFile = Path.Join(testInstance.Path, "module.cs");
1705.WithWorkingDirectory(testInstance.Path)
1710.WithWorkingDirectory(testInstance.Path)
1723var programFile = Path.Join(testInstance.Path, "winexe.cs");
1733.WithWorkingDirectory(testInstance.Path)
1738.WithWorkingDirectory(testInstance.Path)
1748var programFile = Path.Join(testInstance.Path, "exe.cs");
1758.WithWorkingDirectory(testInstance.Path)
1763.WithWorkingDirectory(testInstance.Path)
1773var programFile = Path.Join(testInstance.Path, "exe.cs");
1783File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), """
1795.WithWorkingDirectory(testInstance.Path)
1800.WithWorkingDirectory(testInstance.Path)
1806.WithWorkingDirectory(testInstance.Path)
1816var programFile = Path.Join(testInstance.Path, "appcontainerexe.cs");
1826.WithWorkingDirectory(testInstance.Path)
1831.WithWorkingDirectory(testInstance.Path)
1844var programFile = Path.Join(testInstance.Path, "Program.cs");
1850var publishDir = Path.Join(testInstance.Path, "artifacts");
1854.WithWorkingDirectory(testInstance.Path)
1875var programFile = Path.Join(testInstance.Path, "Program.cs");
1881var publishDir = Path.Join(testInstance.Path, "artifacts");
1885.WithWorkingDirectory(testInstance.Path)
1903var programFile = Path.Join(testInstance.Path, "Program.cs");
1909File.WriteAllText(Path.Join(testInstance.Path, "config.json"), """
1916var publishDir = Path.Join(testInstance.Path, "artifacts");
1920.WithWorkingDirectory(testInstance.Path)
1934var programFile = Path.Join(testInstance.Path, "Program.cs");
1940var publishDir = Path.Join(testInstance.Path, "artifacts");
1944.WithWorkingDirectory(testInstance.Path)
1952new DirectoryInfo(testInstance.Path).File("msbuild.binlog").Should().Exist();
1959var programFile = Path.Join(testInstance.Path, "MyCustomProgram.cs");
1965var publishDir = Path.Join(testInstance.Path, "artifacts");
1969.WithWorkingDirectory(testInstance.Path)
1982var programFile = Path.Join(testInstance.Path, "Program.cs");
1985var customPublishDir = Path.Join(testInstance.Path, "custom-publish");
1989.WithWorkingDirectory(testInstance.Path)
2002var programFile = Path.Join(testInstance.Path, "Program.cs");
2003var publishDir = Path.Join(testInstance.Path, "directive-publish");
2012.WithWorkingDirectory(testInstance.Path)
2025var subDir = Directory.CreateDirectory(Path.Combine(testInstance.Path, "subdir"));
2037.WithWorkingDirectory(testInstance.Path)
2041new DirectoryInfo(testInstance.Path).Sub("subdir").Sub("artifacts").Sub("Program")
2050var programFile = Path.Join(testInstance.Path, "MyFileBasedTool.cs");
2060.WithWorkingDirectory(testInstance.Path)
2068var outputDir = Path.Join(testInstance.Path, "artifacts");
2073.WithWorkingDirectory(testInstance.Path)
2083.WithWorkingDirectory(testInstance.Path)
2096var programFile = Path.Join(testInstance.Path, "MyFileBasedTool.cs");
2104.WithWorkingDirectory(testInstance.Path)
2112var outputDir = Path.Join(testInstance.Path, "custom");
2117.WithWorkingDirectory(testInstance.Path)
2126.WithWorkingDirectory(testInstance.Path)
2136var programFile = Path.Join(testInstance.Path, "Program.cs");
2140.WithWorkingDirectory(testInstance.Path)
2152.WithWorkingDirectory(testInstance.Path)
2166var programFile = Path.Join(testInstance.Path, "Program.cs");
2174.WithWorkingDirectory(testInstance.Path)
2188.WithWorkingDirectory(testInstance.Path)
2204File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program + """
2208var fullPath = Path.Join(testInstance.Path, relativePath);
2217.WithWorkingDirectory(testInstance.Path)
2228.WithWorkingDirectory(testInstance.Path)
2237.WithWorkingDirectory(testInstance.Path)
2253File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program + """
2257Directory.CreateDirectory(Path.Join(testInstance.Path, "Properties"));
2258string launchSettings = Path.Join(testInstance.Path, "Properties", "launchSettings.json");
2260string runJson = Path.Join(testInstance.Path, "Program.run.json");
2264.WithWorkingDirectory(testInstance.Path)
2274.WithWorkingDirectory(testInstance.Path)
2284.WithWorkingDirectory(testInstance.Path)
2305File.WriteAllText(Path.Join(testInstance.Path, "First.cs"), source);
2306File.WriteAllText(Path.Join(testInstance.Path, "First.run.json"), s_launchSettings.Replace("TestProfileMessage", "First"));
2307File.WriteAllText(Path.Join(testInstance.Path, "Second.cs"), source);
2308File.WriteAllText(Path.Join(testInstance.Path, "Second.run.json"), s_launchSettings.Replace("TestProfileMessage", "Second"));
2312.WithWorkingDirectory(testInstance.Path)
2321.WithWorkingDirectory(testInstance.Path)
2334File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """
2341.WithWorkingDirectory(testInstance.Path)
2351File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """
2358.WithWorkingDirectory(testInstance.Path)
2368File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """
2377.WithWorkingDirectory(testInstance.Path)
2390File.WriteAllText(Path.Join(testInstance.Path, "Directory.Packages.props"), """
2400File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """
2409.WithWorkingDirectory(testInstance.Path)
2423File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """
2433.WithWorkingDirectory(testInstance.Path)
2442File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """
2448.WithWorkingDirectory(testInstance.Path)
2462var libDir = Path.Join(testInstance.Path, "Lib");
2481var appDir = Path.Join(testInstance.Path, "App");
2500File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """
2506.WithWorkingDirectory(testInstance.Path)
2509.And.HaveStdErrContaining(DirectiveError(Path.Join(testInstance.Path, "Program.cs"), 1, CliCommandStrings.InvalidProjectDirective,
2510string.Format(CliStrings.CouldNotFindProjectOrDirectory, Path.Join(testInstance.Path, "wrong.csproj"))));
2512File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """
2518.WithWorkingDirectory(testInstance.Path)
2521.And.HaveStdErrContaining(DirectiveError(Path.Join(testInstance.Path, "Program.cs"), 1, CliCommandStrings.InvalidProjectDirective,
2522string.Format(CliStrings.CouldNotFindProjectOrDirectory, Path.Join(testInstance.Path, "dir/"))));
2524Directory.CreateDirectory(Path.Join(testInstance.Path, "dir"));
2528.WithWorkingDirectory(testInstance.Path)
2531.And.HaveStdErrContaining(DirectiveError(Path.Join(testInstance.Path, "Program.cs"), 1, CliCommandStrings.InvalidProjectDirective,
2532string.Format(CliStrings.CouldNotFindAnyProjectInDirectory, Path.Join(testInstance.Path, "dir/"))));
2534File.WriteAllText(Path.Join(testInstance.Path, "dir", "proj1.csproj"), "<Project />");
2535File.WriteAllText(Path.Join(testInstance.Path, "dir", "proj2.csproj"), "<Project />");
2539.WithWorkingDirectory(testInstance.Path)
2542.And.HaveStdErrContaining(DirectiveError(Path.Join(testInstance.Path, "Program.cs"), 1, CliCommandStrings.InvalidProjectDirective,
2543string.Format(CliStrings.MoreThanOneProjectInDirectory, Path.Join(testInstance.Path, "dir/"))));
2569var programPath = Path.Join(testInstance.Path, "Program.cs");
2581.WithWorkingDirectory(testInstance.Path)
2588.WithWorkingDirectory(testInstance.Path)
2595.WithWorkingDirectory(testInstance.Path)
2624string entryPointPath = Path.Join(testInstance.Path, fileName);
2633.WithWorkingDirectory(testInstance.Path)
2639var msbuildCall = FindCompilerCall(Path.Join(testInstance.Path, "msbuild.binlog"));
2844.WithWorkingDirectory(testInstance.Path)
2901string entryPointPath = Path.Join(testInstance.Path, fileName);
2917.WithWorkingDirectory(testInstance.Path)
2930.WithWorkingDirectory(testInstance.Path)
2980File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """
2985var artifactsDir = VirtualProjectBuildingCommand.GetArtifactsPath(Path.Join(testInstance.Path, "Program.cs"));
2995File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program);
3002File.WriteAllText(Path.Join(testInstance.Path, "Program2.cs"), "test");
3007string buildPropsFile = Path.Join(testInstance.Path, "Directory.Build.props");
3027string importedFile = Path.Join(testInstance.Path, "Settings.props");
3089.WithWorkingDirectory(testInstance.Path)
3109.WithWorkingDirectory(testInstance.Path)
3114var binlogs = new DirectoryInfo(testInstance.Path)
3136File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program);
3139.WithWorkingDirectory(testInstance.Path)
3156File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), code);
3157File.WriteAllText(Path.Join(testInstance.Path, "Resources.resx"), s_resx);
3162File.WriteAllText(Path.Join(testInstance.Path, "Resources.resx"), s_resx.Replace("TestValue", "UpdatedValue"));
3167File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), "//v2\n" + code);
3185File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), code);
3186File.WriteAllText(Path.Join(testInstance.Path, "Resources.resx"), s_resx);
3191File.WriteAllText(Path.Join(testInstance.Path, "Resources.resx"), s_resx.Replace("TestValue", "UpdatedValue"));
3196File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), "//v2\n" + code);
3203File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), "//v3\n" + code);
3220File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), code);
3221File.WriteAllText(Path.Join(testInstance.Path, "Resources.resx"), s_resx);
3226File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), "//v2\n" + code);
3231File.WriteAllText(Path.Join(testInstance.Path, "Resources.resx"), s_resx.Replace("TestValue", "UpdatedValue"));
3236File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), "//v3\n" + code);
3248File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """
3253var artifactsDir = VirtualProjectBuildingCommand.GetArtifactsPath(Path.Join(testInstance.Path, "Program.cs"));
3258File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """
3279File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """
3285.WithWorkingDirectory(testInstance.Path)
3293File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """
3298.WithWorkingDirectory(testInstance.Path)
3314File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """
3326.WithWorkingDirectory(testInstance.Path)
3335File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), "<Project />");
3338.WithWorkingDirectory(testInstance.Path)
3365File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """
3371var artifactsDir = VirtualProjectBuildingCommand.GetArtifactsPath(Path.Join(testInstance.Path, "Program.cs"));
3374File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), "<Project />");
3377.WithWorkingDirectory(testInstance.Path)
3383File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), """
3393File.Delete(Path.Join(testInstance.Path, "Directory.Build.props"));
3396.WithWorkingDirectory(testInstance.Path)
3411File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program);
3414var artifactsDir = VirtualProjectBuildingCommand.GetArtifactsPath(Path.Join(testInstance.Path, "Program.cs"));
3418.WithEnvironmentVariable("NUGET_PACKAGES", Path.Join(testInstance.Path, "packages"))
3419.WithWorkingDirectory(testInstance.Path)
3426.WithEnvironmentVariable("NUGET_PACKAGES", Path.Join(testInstance.Path, "packages"))
3427.WithWorkingDirectory(testInstance.Path)
3432File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """
3437.WithEnvironmentVariable("NUGET_PACKAGES", Path.Join(testInstance.Path, "packages"))
3438.WithWorkingDirectory(testInstance.Path)
3453var programPath = Path.Join(testInstance.Path, programFileName);
3470var programPath = Path.Join(testInstance.Path, "Program.cs");
3500var programPath = Path.Join(testInstance.Path, "Program.cs");
3559var programPath = Path.Join(testInstance.Path, programFileName);
3582var programPath = Path.Join(testInstance.Path, "Program.cs");
3620var programPath = Path.Join(testInstance.Path, "Program.cs");
3651var libDir = Path.Join(testInstance.Path, "Lib");
3672var appDir = Path.Join(testInstance.Path, "App");
3714File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), $"""
3732var programPath = Path.Join(testInstance.Path, "Program.cs");
3763var programPath = Path.Join(testInstance.Path, "Program.cs");
3798var programPath = Path.Join(testInstance.Path, "Program.cs");
3859<RuntimeHostConfigurationOption Include="EntryPointFileDirectoryPath" Value="{testInstance.Path}" />
3875var programPath = Path.Join(testInstance.Path, "Program.cs");
3924<RuntimeHostConfigurationOption Include="EntryPointFileDirectoryPath" Value="{testInstance.Path}" />
3943var programPath = Path.Join(testInstance.Path, "Program.cs");
3992<RuntimeHostConfigurationOption Include="EntryPointFileDirectoryPath" Value="{testInstance.Path}" />
4028var programPath = Path.Join(testInstance.Path, "Program.cs");
4055var filePath = Path.Join(testInstance.Path, "Program.cs");
4070.WithWorkingDirectory(testInstance.Path)
4080File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """"
4086.WithWorkingDirectory(testInstance.Path)
4089.And.HaveStdOut($"EntryPointFileDirectoryPath: {testInstance.Path}");
4097File.WriteAllText(Path.Join(testInstance.Path, fileName), """
4102var relativePath = Path.GetRelativePath(Directory.GetCurrentDirectory(), Path.Join(testInstance.Path, fileName));
4114var dirWithSpaces = Path.Join(testInstance.Path, "dir with spaces");
4123.WithWorkingDirectory(testInstance.Path)
4134File.WriteAllText(Path.Join(testInstance.Path, fileName), """
4140.WithWorkingDirectory(testInstance.Path)
4143.And.HaveStdOut($"EntryPointFileDirectoryPath: {testInstance.Path}");
4151var filePath = Path.Join(testInstance.Path, unicodeFileName);
4158.WithWorkingDirectory(testInstance.Path)
4169File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program);
4172.WithWorkingDirectory(testInstance.Path)
4199File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program);
4201File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), """
4216.WithWorkingDirectory(testInstance.Path)
4221File.WriteAllText(Path.Join(testInstance.Path, "Program.csproj"), s_consoleProject);
4224.WithWorkingDirectory(testInstance.Path)
4236var result = new DirectoryInfo(testInstance.Path)
4245File.Delete(Path.Join(testInstance.Path, file));
CommandTests\Solution\Migrate\GivenDotnetSlnMigrate.cs (1)
18.Path;
CommandTests\Test\GivenDotnetTestBuildsAndRunsArtifactPostProcessing.cs (19)
32string runsettings = GetRunsetting(testInstance.Path);
35.WithWorkingDirectory(testInstance.Path)
42"--diag", testInstance.Path + "/logs/");
56string runsettings = GetRunsetting(testInstance.Path);
58new PublishCommand(Log, Path.Combine(testInstance.Path, "sln.sln")).Execute("/p:Configuration=Release").Should().Pass();
61.WithWorkingDirectory(testInstance.Path)
65Directory.GetFiles(testInstance.Path, "test1.dll", SearchOption.AllDirectories).SingleOrDefault(x => x.Contains("publish")),
66Directory.GetFiles(testInstance.Path, "test2.dll", SearchOption.AllDirectories).SingleOrDefault(x => x.Contains("publish")),
67Directory.GetFiles(testInstance.Path, "test3.dll", SearchOption.AllDirectories).SingleOrDefault(x => x.Contains("publish")),
71"--diag:" + testInstance.Path + "/logs/");
85string runsettings = GetRunsetting(testInstance.Path);
87new PublishCommand(Log, Path.Combine(testInstance.Path, "sln.sln")).Execute("/p:Configuration=Release").Should().Pass();
90.WithWorkingDirectory(testInstance.Path)
93Directory.GetFiles(testInstance.Path, "test1.dll", SearchOption.AllDirectories).SingleOrDefault(x => x.Contains("publish")),
94Directory.GetFiles(testInstance.Path, "test2.dll", SearchOption.AllDirectories).SingleOrDefault(x => x.Contains("publish")),
95Directory.GetFiles(testInstance.Path, "test3.dll", SearchOption.AllDirectories).SingleOrDefault(x => x.Contains("publish")),
99$"--diag:{testInstance.Path}/logs/");
162string testProjectDirectory = testInstance.Path;
177string testProjectDirectory = testInstance.Path;
CommandTests\Workload\Install\GivenWorkloadManifestUpdater.cs (21)
97var testDir = _testAssetsManager.CreateTestDirectory().Path;
143var testDir = _testAssetsManager.CreateTestDirectory().Path;
221var testDir = _testAssetsManager.CreateTestDirectory(identifier: useOfflineCache.ToString()).Path;
300var testDir = _testAssetsManager.CreateTestDirectory().Path;
366var testDir = _testAssetsManager.CreateTestDirectory().Path;
421var testDir = _testAssetsManager.CreateTestDirectory().Path;
459var testDir = _testAssetsManager.CreateTestDirectory().Path;
502var testDir = _testAssetsManager.CreateTestDirectory().Path;
545var testDir = _testAssetsManager.CreateTestDirectory().Path;
586Directory.CreateDirectory(Path.Combine(testInstance.Path, ".dotnet"));
587File.WriteAllText(Path.Combine(testInstance.Path, ".dotnet", $".workloadAdvertisingUpdates{sdkFeatureBand}"), @"[""maui""]");
589File.WriteAllText(Path.Combine(testInstance.Path, ".dotnet", $".workloadAdvertisingManifestSentinel{sdkFeatureBand}"), string.Empty);
593.WithEnvironmentVariable("DOTNET_CLI_HOME", testInstance.Path)
594.WithWorkingDirectory(testInstance.Path)
624Directory.CreateDirectory(Path.Combine(testInstance.Path, ".dotnet"));
625File.WriteAllText(Path.Combine(testInstance.Path, ".dotnet", $".workloadAdvertisingUpdates6.0.100"), @"[""maui""]");
627File.WriteAllText(Path.Combine(testInstance.Path, ".dotnet", ".workloadAdvertisingManifestSentinel" + sdkFeatureBand.ToString()), string.Empty);
631.WithEnvironmentVariable("DOTNET_CLI_HOME", testInstance.Path)
632.WithWorkingDirectory(testInstance.Path)
648var testDir = _testAssetsManager.CreateTestDirectory().Path;
690var testDir = _testAssetsManager.CreateTestDirectory(testName: testName).Path;
CommandTests\Workload\Restore\GivenDotnetWorkloadRestore.cs (2)
28.Path;
51.Path;
dotnet-format.UnitTests (13)
dotnet-MsiInstallation.Tests (1)
dotnet-new.IntegrationTests (40)
PostActionTests.cs (29)
30string templateLocation = _testAssetsManager.CopyTestAsset(templatePartLocation, testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path;
63string templateLocation = _testAssetsManager.CopyTestAsset("PostActions/RestoreNuGet/Basic", testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path;
99string templateLocation = _testAssetsManager.CopyTestAsset("PostActions/RestoreNuGet/Basic", testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path;
137string templateLocation = _testAssetsManager.CopyTestAsset(templatePartLocation, testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path;
172string templateLocation = _testAssetsManager.CopyTestAsset(templatePartLocation, testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path;
214string templateLocation = _testAssetsManager.CopyTestAsset(templatePartLocation, testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path;
263string templateLocation = _testAssetsManager.CopyTestAsset(templatePartLocation, testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path;
312string templateLocation = _testAssetsManager.CopyTestAsset("PostActions/RunScript/Basic", testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path;
345string templateLocation = _testAssetsManager.CopyTestAsset("PostActions/RunScript/DoNotRedirect", testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path;
370string templateLocation = _testAssetsManager.CopyTestAsset("PostActions/RunScript/Redirect", testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path;
395string templateLocation = _testAssetsManager.CopyTestAsset("PostActions/RunScript/RedirectOnError", testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path;
430string templateLocation = _testAssetsManager.CopyTestAsset(templatePartLocation, testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path;
459string templateLocation = _testAssetsManager.CopyTestAsset("PostActions/AddPackageReference/Basic", testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path;
491string templateLocation = _testAssetsManager.CopyTestAsset("PostActions/AddPackageReference/Basic", testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path;
522string templateLocation = _testAssetsManager.CopyTestAsset("PostActions/AddProjectReference/Basic", testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path;
558string templateLocation = _testAssetsManager.CopyTestAsset("PostActions/AddProjectReference/Existing", testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path;
603var templateLocation = _testAssetsManager.CopyTestAsset("PostActions/AddProjectReference/ExistingWithRename", testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path;
650string templateLocation = _testAssetsManager.CopyTestAsset("PostActions/AddProjectReference/Basic", testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path;
681string templateLocation = _testAssetsManager.CopyTestAsset("PostActions/AddProjectReference/Basic", testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path;
713string templateLocation = _testAssetsManager.CopyTestAsset(templatePartLocation, testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path;
752string templateLocation = _testAssetsManager.CopyTestAsset(templatePartLocation, testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path;
784string templateLocation = _testAssetsManager.CopyTestAsset("PostActions/AddProjectToSolution/BasicInSolutionRoot", testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path;
820string templateLocation = _testAssetsManager.CopyTestAsset("PostActions/AddProjectToSolution/Basic", testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path;
856string templateLocation = _testAssetsManager.CopyTestAsset("PostActions/AddProjectToSolution/Basic", testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path;
892string templateLocation = _testAssetsManager.CopyTestAsset("PostActions/AddProjectToSolution/BasicWithIndexes", testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path;
931string templateLocation = _testAssetsManager.CopyTestAsset("PostActions/Instructions/Basic", testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path;
957string templateLocation = _testAssetsManager.CopyTestAsset("AddProjectReference", testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path;
978string templateLocation = _testAssetsManager.CopyTestAsset("AddPackageReference", testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path;
997string templateLocation = _testAssetsManager.CopyTestAsset("AddProjectToSolution", testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path;
dotnet-watch.Tests (106)
CommandLine\ProgramTests.cs (5)
26TestOptions.GetEnvironmentOptions(workingDirectory: testAsset.Path, TestContext.Current.ToolsetUnderTest.DotNetHostPath, testAsset),
210var testFile = Path.Combine(testAsset.Path, "UnitTest1.cs");
274var packagePath = Path.Combine(testAsset.Path, "bin", "Release", "WatchNoDepsApp.1.0.0.nupkg");
343App.AssertOutputContains($"dotnet watch ❌ The project file could not be loaded. Could not find a part of the path '{Path.Combine(testAsset.Path, "AppWithDeps", "NonExistentDirectory", "X.csproj")}'");
358testAsset.Path,
HotReload\ApplyDeltaTests.cs (46)
20var dependencyDir = Path.Combine(testAsset.Path, "Dependency");
55var dependencyDir = Path.Combine(testAsset.Path, "Dependency");
80var dependencyDir = Path.Combine(testAsset.Path, "Dependency");
87Path.Combine(testAsset.Path, "Directory.Build.props"),
121var dependencyDir = Path.Combine(testAsset.Path, "Dependency");
123var buildFilePath = isDirectoryProps ? Path.Combine(testAsset.Path, "Directory.Build.props") : Path.Combine(dependencyDir, "Dependency.csproj");
160var dependencyDir = Path.Combine(testAsset.Path, "Dependency");
162var directoryBuildProps = Path.Combine(testAsset.Path, "Directory.Build.props");
203var dependencyDir = Path.Combine(testAsset.Path, "Dependency");
205var directoryBuildProps = Path.Combine(testAsset.Path, "Directory.Build.props");
250var appDataDir = Path.Combine(testAsset.Path, "AppData", "dir");
265await App.WaitUntilOutputContains($"dotnet watch ⌚ Ignoring change in excluded file '{appDataFilePath}': Add. Path matches DefaultItemExcludes glob 'AppData/**/*.*' set in '{testAsset.Path}'.");
288var binDir = Path.Combine(testAsset.Path, "bin", "Debug", ToolsetInfo.CurrentTargetFramework);
291var objDir = Path.Combine(testAsset.Path, "obj", "Debug", ToolsetInfo.CurrentTargetFramework);
316var programPath = Path.Combine(testAsset.Path, "Program.cs");
317var projectPath = Path.Combine(testAsset.Path, "WatchHotReloadApp.csproj");
353var projectPath = Path.Combine(testAsset.Path, "WatchHotReloadApp.csproj");
354var logDir = Path.Combine(testAsset.Path, "logs");
420var programPath = Path.Combine(testAsset.Path, "Program.cs");
451var programPath = Path.Combine(testAsset.Path, "Program.cs");
507var programPath = Path.Combine(testAsset.Path, "Program.cs");
562var programPath = Path.Combine(testAsset.Path, "Program.cs");
596var programPath = Path.Combine(testAsset.Path, "Program.cs");
623UpdateSourceFile(Path.Combine(testAsset.Path, "Program.fs"), content => content.Replace("Hello World!", "<Updated>"));
648var sourcePath = Path.Combine(testAsset.Path, "Program.fs");
693UpdateSourceFile(Path.Combine(testAsset.Path, "App", "Update.cs"), newSrc);
704var sourcePath = Path.Combine(testAsset.Path, "Program.cs");
737var sourcePath = Path.Combine(testAsset.Path, "Program.cs");
787var programPath = Path.Combine(testAsset.Path, "Program.cs");
820var programPath = Path.Combine(testAsset.Path, "Program.cs");
889UpdateSourceFile(Path.Combine(testAsset.Path, "Pages", "Index.razor"), newSource);
988var scopedCssPath = Path.Combine(testAsset.Path, "RazorClassLibrary", "Components", "Example.razor.css");
1004var cssPath = Path.Combine(testAsset.Path, "RazorApp", "wwwroot", "app.css");
1028WorkingDirectory = testAsset.Path,
1041var razorPath = Path.Combine(testAsset.Path, "Components", "Pages", "Home.razor");
1052var cssPath = Path.Combine(testAsset.Path, "wwwroot", "css", "app.css");
1088foreach (var depDll in Directory.GetFiles(testAsset.Path, "Dep2.dll", SearchOption.AllDirectories))
1093File.WriteAllText(Path.Combine(testAsset.Path, "App", "Update.cs"), newSrc);
1108var dependencyDir = Path.Combine(testAsset.Path, "Dependency");
1160var dependencyDir = Path.Combine(testAsset.Path, "Dependency");
1215var serviceSourcePath = Path.Combine(testAsset.Path, "WatchAspire.ApiService", "Program.cs");
1216var serviceProjectPath = Path.Combine(testAsset.Path, "WatchAspire.ApiService", "WatchAspire.ApiService.csproj");
1219var webSourcePath = Path.Combine(testAsset.Path, "WatchAspire.Web", "Program.cs");
1220var webProjectPath = Path.Combine(testAsset.Path, "WatchAspire.Web", "WatchAspire.Web.csproj");
1316var webSourcePath = Path.Combine(testAsset.Path, "WatchAspire.Web", "Program.cs");
1317var webProjectPath = Path.Combine(testAsset.Path, "WatchAspire.Web", "WatchAspire.Web.csproj");
HotReload\RuntimeProcessLauncherTests.cs (25)
100var environmentOptions = TestOptions.GetEnvironmentOptions(workingDirectory ?? testAsset.Path, TestContext.Current.ToolsetUnderTest.DotNetHostPath, testAsset);
153var workingDirectory = testAsset.Path;
154var hostDir = Path.Combine(testAsset.Path, "Host");
156var serviceDirA = Path.Combine(testAsset.Path, "ServiceA");
160var serviceDirB = Path.Combine(testAsset.Path, "ServiceB");
162var libDir = Path.Combine(testAsset.Path, "Lib");
318var workingDirectory = testAsset.Path;
319var hostDir = Path.Combine(testAsset.Path, "Host");
321var serviceDirA = Path.Combine(testAsset.Path, "ServiceA");
323var serviceDirB = Path.Combine(testAsset.Path, "ServiceB");
325var libDir = Path.Combine(testAsset.Path, "Lib");
412var workingDirectory = testAsset.Path;
413var hostDir = Path.Combine(testAsset.Path, "Host");
416var libProject = Path.Combine(testAsset.Path, "Lib2", "Lib2.csproj");
417var lib = Path.Combine(testAsset.Path, "Lib2", "Lib2.cs");
501var workingDirectory = testAsset.Path;
502var hostDir = Path.Combine(testAsset.Path, "Host");
504var serviceDirA = Path.Combine(testAsset.Path, "ServiceA");
557var workingDirectory = testAsset.Path;
654var workingDirectory = testAsset.Path;
655var projectPath = Path.Combine(testAsset.Path, "WatchHotReloadApp.csproj");
656var programPath = Path.Combine(testAsset.Path, "Program.cs");
708var appProjDir = Path.Combine(testAsset.Path, "AppWithDeps");
770var projFilePath = Path.Combine(testAsset.Path, "WatchHotReloadApp.csproj");
771var programFilePath = Path.Combine(testAsset.Path, "Program.cs");
EndToEnd.Tests (28)
Microsoft.AspNetCore.Watch.BrowserRefresh.Tests (1)
Microsoft.CodeAnalysis.NetAnalyzers.UnitTests (1)
Microsoft.DotNet.ApiCompat.IntegrationTests (1)
Microsoft.DotNet.ApiCompat.Tests (1)
Microsoft.DotNet.ApiCompatibility.Tests (1)
Microsoft.DotNet.ApiDiff.Tests (1)
Microsoft.DotNet.ApiSymbolExtensions.Tests (1)
Microsoft.DotNet.Cli.Utils.Tests (6)
Microsoft.DotNet.GenAPI.Tests (1)
Microsoft.DotNet.HotReload.Client.Tests (1)
Microsoft.DotNet.MSBuildSdkResolver.Tests (1)
Microsoft.DotNet.PackageInstall.Tests (26)
Microsoft.DotNet.PackageValidation.Tests (1)
Microsoft.Extensions.DotNetDeltaApplier.Tests (1)
Microsoft.NET.Build.Containers.UnitTests (1)
Microsoft.NET.Build.Extensions.Tasks.UnitTests (1)
Microsoft.NET.Build.Tasks.UnitTests (7)
Microsoft.NET.Build.Tests (143)
ArtifactsOutputPathTests.cs (53)
52File.WriteAllText(Path.Combine(testAsset.Path, "Directory.Build.props"),
64File.WriteAllText(Path.Combine(testAsset.Path, "Directory.Build.props"),
83.WithWorkingDirectory(testAsset.Path)
92OutputPathCalculator outputPathCalculator = OutputPathCalculator.FromProject(Path.Combine(testAsset.Path, testProject.Name), testProject);
105.WithWorkingDirectory(testAsset.Path)
114OutputPathCalculator outputPathCalculator = OutputPathCalculator.FromProject(Path.Combine(testAsset.Path, testProject.Name), testProject);
130.WithWorkingDirectory(testAsset.Path)
139OutputPathCalculator outputPathCalculator = OutputPathCalculator.FromProject(Path.Combine(testAsset.Path, testProject.Name), testProject);
169.WithWorkingDirectory(testAsset.Path)
176var outputPathCalculator = OutputPathCalculator.FromProject(testAsset.Path, testProject);
178outputPathCalculator.ArtifactsPath = Path.Combine(testAsset.Path, testProject.Name, "artifacts");
206new DirectoryInfo(OutputPathCalculator.FromProject(testAsset.Path, testProject).GetOutputDirectory())
211File.WriteAllText(Path.Combine(testAsset.Path, "Directory.Build.props"), """
224new DirectoryInfo(OutputPathCalculator.FromProject(testAsset.Path, testProject).GetOutputDirectory())
229File.Delete(Path.Combine(testAsset.Path, "Directory.Build.props"));
248File.WriteAllText(Path.Combine(testAsset.Path, "Directory.Build.props"), """
257File.WriteAllText(Path.Combine(testAsset.Path, "Directory.AfterTargetFrameworkInference.targets"), """
271new DirectoryInfo(Path.Combine(testAsset.Path, "artifacts", "bin", testProject.Name, "NET8_Debug")).Should().Exist();
272new DirectoryInfo(Path.Combine(testAsset.Path, "artifacts", "bin", testProject.Name, "NET7_Debug")).Should().Exist();
273new DirectoryInfo(Path.Combine(testAsset.Path, "artifacts", "bin", testProject.Name, "debug_netstandard2.0")).Should().Exist();
275new DirectoryInfo(Path.Combine(testAsset.Path, "artifacts", "bin", testProject.Name, "debug_net8.0")).Should().NotExist();
276new DirectoryInfo(Path.Combine(testAsset.Path, "artifacts", "bin", testProject.Name, "debug_net7.0")).Should().NotExist();
278new DirectoryInfo(Path.Combine(testAsset.Path, "artifacts", "obj", testProject.Name, "NET8_Debug")).Should().Exist();
279new DirectoryInfo(Path.Combine(testAsset.Path, "artifacts", "obj", testProject.Name, "NET7_Debug")).Should().Exist();
280new DirectoryInfo(Path.Combine(testAsset.Path, "artifacts", "obj", testProject.Name, "debug_netstandard2.0")).Should().Exist();
282new DirectoryInfo(Path.Combine(testAsset.Path, "artifacts", "obj", testProject.Name, "debug_net8.0")).Should().NotExist();
283new DirectoryInfo(Path.Combine(testAsset.Path, "artifacts", "obj", testProject.Name, "debug_net7.0")).Should().NotExist();
288.WithWorkingDirectory(Path.Combine(testAsset.Path, testProject.Name))
295new DirectoryInfo(Path.Combine(testAsset.Path, "artifacts", "publish", testProject.Name, "NET8_Release")).Should().Exist();
296new DirectoryInfo(Path.Combine(testAsset.Path, "artifacts", "publish", testProject.Name, "NET7_Debug")).Should().Exist();
297new DirectoryInfo(Path.Combine(testAsset.Path, "artifacts", "publish", testProject.Name, "debug_netstandard2.0")).Should().Exist();
300.WithWorkingDirectory(Path.Combine(testAsset.Path, testProject.Name))
305new DirectoryInfo(Path.Combine(testAsset.Path, "artifacts", "package", "release")).Should().Exist();
306new FileInfo(Path.Combine(testAsset.Path, "artifacts", "package", "release", testProject.Name + ".1.0.0.nupkg")).Should().Exist();
319File.WriteAllText(Path.Combine(testAsset.Path, "Directory.Build.props"),
335var artifactsFolder = _testAssetsManager.CreateTestDirectory(identifier: "ArtifactsPath").Path;
361new FileInfo(Path.Combine(testAsset.Path, "artifacts", "binaries", "App", "debug", "App.dll"))
372.WithWorkingDirectory(testAsset.Path)
377new FileInfo(Path.Combine(testAsset.Path, "artifacts", "published_app", "App", "release", "App.dll"))
388.WithWorkingDirectory(testAsset.Path)
393new FileInfo(Path.Combine(testAsset.Path, "artifacts", "package_output", "release", "App.1.0.0.nupkg"))
404.WithWorkingDirectory(testAsset.Path)
409new FileInfo(Path.Combine(testAsset.Path, "artifacts", "bin", "Apps", "MyApp", "debug", "App.dll"))
428File.WriteAllText(Path.Combine(testAsset.Path, "Directory.Build.props"),
511new DirectoryInfo(Path.Combine(testAsset.Path, "artifacts", "MSBuildSdk", ToolsetInfo.CurrentTargetFramework))
518new DirectoryInfo(Path.Combine(testAsset.Path, "artifacts", "PackageReference", ToolsetInfo.CurrentTargetFramework))
524new DirectoryInfo(Path.Combine(testAsset.Path, "artifacts", "PackageReference", ToolsetInfo.CurrentTargetFramework))
530new FileInfo(Path.Combine(testAsset.Path, "MSBuildSdk", "bin", "Debug", ToolsetInfo.CurrentTargetFramework, "MSBuildSdk.dll")).Should().Exist();
531new FileInfo(Path.Combine(testAsset.Path, "MSBuildSdk", "obj", "Debug", ToolsetInfo.CurrentTargetFramework, "MSBuildSdk.dll")).Should().Exist();
552File.WriteAllText(Path.Combine(testAsset.Path, "Directory.Build.props"), """
560var projectDir = Path.Combine(testAsset.Path, testAsset.TestProject.Name);
574var outputDir = new DirectoryInfo(OutputPathCalculator.FromProject(testAsset.Path, testProject).GetOutputDirectory(configuration: "release"));
578var publishDir = new DirectoryInfo(OutputPathCalculator.FromProject(testAsset.Path, testProject).GetPublishDirectory(configuration: "release"));
GivenThatWeWantToBuildWithATargetPlatform.cs (3)
32var getValuesCommand = new GetValuesCommand(Log, Path.Combine(testAsset.Path, testProj.Name), targetFramework, valueName);
70var getValuesCommand = new GetValuesCommand(Log, Path.Combine(testAsset.Path, testProj.Name), targetFramework, "TargetPlatformIdentifier");
88var build = new BuildCommand(Log, Path.Combine(testAsset.Path, testProject.Name));
GivenThatWeWantToReferenceAProject.cs (9)
169File.WriteAllText(Path.Combine(childAsset.Path, childProject.Name, contentName), childProject.Name);
181.WithProjectChanges(project => AddProjectChanges(project, Path.Combine(childAsset.Path, childProject.Name, childProject.Name + ".csproj")));
182File.WriteAllText(Path.Combine(parentAsset.Path, parentProject.Name, contentName), parentProject.Name);
187var getValuesCommand = new GetValuesCommand(Log, Path.Combine(parentAsset.Path, parentProject.Name), tfm, "ResultOutput")
197valuesResult.Should().BeEquivalentTo(Path.GetFullPath(Path.Combine(parentAsset.Path, parentProject.Name, contentName)),
198Path.GetFullPath(Path.Combine(childAsset.Path, childProject.Name, contentName)));
203valuesResult.First().Should().Contain(Path.GetFullPath(Path.Combine(parentAsset.Path, parentProject.Name, contentName)));
269File.WriteAllText(Path.Combine(testAsset.Path, testProjectA.Name, "a.txt"), "A");
277var contentPath = Path.Combine(testProjectC.GetOutputDirectory(testAsset.Path), "a.txt");
GivenWeWantToRequireWindowsForDesktopApps.cs (8)
151new BuildCommand(Log, testInstance.Path)
178var command = new BuildCommand(Log, Path.Combine(asset.Path, ProjectName));
206var command = new BuildCommand(Log, Path.Combine(asset.Path, ProjectName));
237var buildCommand = new BuildCommand(Log, Path.Combine(asset.Path, ProjectName));
264Path.Combine(asset.Path, testProject.Name),
292Path.Combine(asset.Path, testProject.Name),
306FullAssetPath = Path.GetFullPath(Path.Combine(asset.Path, testProject.Name, item.metadata["OutputPath"]))
360Path.Combine(testAsset.Path, testProject.Name),
SourceLinkTests.cs (19)
124CreateGitFiles(testAsset.Path, originUrl: null, commitSha: null);
143CreateGitFiles(testAsset.Path, originUrl: null);
159CreateGitFiles(testAsset.Path, originUrl: "https://contoso.com");
163WorkingDirectory = testAsset.Path
191CreateGitFiles(testAsset.Path, origin);
195WorkingDirectory = testAsset.Path
205var expectedPattern = Path.Combine(testAsset.Path, "*").Replace("\\", "\\\\");
240CreateGitFiles(testAsset.Path, "https://github.com/org/repo");
244WorkingDirectory = testAsset.Path
274CreateGitFiles(testAsset.Path, "https://github.com/org/repo");
278WorkingDirectory = testAsset.Path
300var intDir = Path.Combine(testAsset.Path, "NETCoreCppCliTest", "IntDir");
306CreateGitFiles(testAsset.Path, "https://github.com/org/repo");
310WorkingDirectory = testAsset.Path
317var expectedPattern = Path.Combine(testAsset.Path, "*").Replace("\\", "\\\\");
321var outputDir = Path.Combine(testAsset.Path, "NETCoreCppCliTest", "x64", "Debug");
333CreateGitFiles(testAsset.Path, "https://github.com/org/repo");
337WorkingDirectory = Path.Combine(testAsset.Path, "FxWpf")
342Assert.True(File.Exists(Path.Combine(testAsset.Path, "obj", "net472", "MainWindow.g.cs")));
Microsoft.NET.Clean.Tests (1)
Microsoft.NET.Pack.Tests (10)
GivenThatWeWantToPackAHelloWorldProject.cs (7)
87File.WriteAllText(Path.Combine(helloWorldAsset.Path, "Directory.Build.props"), "<Project><PropertyGroup><PackRelease>true</PackRelease></PropertyGroup></Project>");
97var expectedAssetPath = Path.Combine(helloWorldAsset.Path, "bin", optedOut ? "Debug" : "Release", "HelloWorld.1.0.0.nupkg");
123var expectedAssetPath = Path.Combine(helloWorldAsset.Path, "bin", valueOfPackRelease == "true" ? "Release" : "Debug", "HelloWorld.1.0.0.nupkg");
155var expectedAssetPath = Path.Combine(helloWorldAsset.Path, "bin", expectedConfiguration, "HelloWorld.1.0.0.nupkg");
168File.WriteAllText(helloWorldAsset.Path + "/Directory.Build.props", "<Project><PropertyGroup><PackRelease>false</PackRelease></PropertyGroup></Project>");
177var unexpectedAssetPath = Path.Combine(helloWorldAsset.Path, "bin", "Debug", tfm, "HelloWorld.dll");
179var expectedAssetPath = Path.Combine(helloWorldAsset.Path, "bin", "Release", tfm, "HelloWorld.dll");
Microsoft.NET.Publish.Tests (84)
GivenThatWeWantToPublishAHelloWorldProject.cs (17)
435File.WriteAllText(Path.Combine(helloWorldAsset.Path, "Directory.Build.props"), "<Project><PropertyGroup><PublishRelease>true</PublishRelease></PropertyGroup></Project>");
443var expectedAssetPath = Path.Combine(helloWorldAsset.Path, "bin", optedOut ? "Debug" : "Release", ToolsetInfo.CurrentTargetFramework, "HelloWorld.dll");
465var expectedAssetPath = Path.Combine(helloWorldAsset.Path, "bin", "Debug", ToolsetInfo.CurrentTargetFramework, "HelloWorld.dll");
467var releaseAssetPath = Path.Combine(helloWorldAsset.Path, "bin", "Release", ToolsetInfo.CurrentTargetFramework, "HelloWorld.dll");
478.Path;
497.Path;
515.Path;
566var expectedAssetPath = Path.Combine(helloWorldAsset.Path, "bin", "Release", ToolsetInfo.CurrentTargetFramework, "HelloWorld.dll");
597var expectedAssetPath = Path.Combine(helloWorldAsset.Path, "bin", "Debug", tfm, "HelloWorld.dll");
599var releaseAssetPath = Path.Combine(helloWorldAsset.Path, "bin", "Release", tfm, "HelloWorld.dll");
675var publishProfilesDirectory = Path.Combine(helloWorldAsset.Path, "Properties", "PublishProfiles");
687var publishCommand = new DotnetPublishCommand(Log, helloWorldAsset.Path);
693var releaseAssetPath = Path.Combine(helloWorldAsset.Path, "bin", "Release", ToolsetInfo.CurrentTargetFramework, rid, "HelloWorld.dll");
862var projectDirectory = Path.Combine(testProjectInstance.Path, testProject.Name);
945var projectDirectory = Path.Combine(testProjectInstance.Path, testProject.Name);
992var projectDirectory = Path.Combine(testProjectInstance.Path, testProject.Name);
1049var projectDirectory = Path.Combine(testProjectInstance.Path, testProject.Name);
GivenThatWeWantToPublishTrimmedWindowsFormsAndWPFApps.cs (18)
121.WithWorkingDirectory(testDir.Path)
126var project = XDocument.Load(Path.Combine(testDir.Path, Path.GetFileName(testDir.Path) + ".csproj"));
134string mainWindowXamlCsPath = Path.Combine(testDir.Path, "Form1.cs");
142var restoreCommand = new RestoreCommand(Log, testDir.Path);
147var publishCommand = new PublishCommand(Log, testDir.Path);
153var publishDirectory = OutputPathCalculator.FromProject(Path.Combine(testDir.Path, Path.GetFileName(testDir.Path) + ".csproj")).GetPublishDirectory(
172FileName = Path.Combine(publishDirectory, Path.GetFileName(testDir.Path) + ".exe")
193.WithWorkingDirectory(testDir.Path)
198var project = XDocument.Load(Path.Combine(testDir.Path, Path.GetFileName(testDir.Path) + ".csproj"));
206string mainWindowXamlCsPath = Path.Combine(testDir.Path, "MainWindow.xaml.cs");
214var restoreCommand = new RestoreCommand(Log, testDir.Path);
219var publishCommand = new PublishCommand(Log, testDir.Path);
225var publishDirectory = OutputPathCalculator.FromProject(Path.Combine(testDir.Path, Path.GetFileName(testDir.Path) + ".csproj")).GetPublishDirectory(
244FileName = Path.Combine(publishDirectory, Path.GetFileName(testDir.Path) + ".exe")
GivenThatWeWantToTestAMultitargetedSolutionWithPublishReleaseOrPackRelease.cs (21)
86.Execute(args.Append(testAsset.Path))
93finalPropertyResults.Add(testProject.GetPropertyValues(testAsset.Path, expectedTfm, expectedConfiguration));
108.Execute(testAsset.Path)
115finalPropertyResults.Add(testProject.GetPropertyValues(testAsset.Path, "net8.0", expectedConfiguration));
132.Execute(testAsset.Path)
139finalPropertyResults.Add(testProject.GetPropertyValues(testAsset.Path, testProject == testProjects[0] ? firstProjectTfm : secondProjectTfm, expectedConfiguration));
157.Execute(passDashF ? "-f" : "", args, testAsset.Path)
164finalPropertyResults.Add(testProject.GetPropertyValues(testAsset.Path, expectedTfm, expectedConfiguration));
181.Execute(testAsset.Path)
188finalPropertyResults.Add(testProject.GetPropertyValues(testAsset.Path, testProject == testProjects[0] ? firstProjectTfm : secondProjectTfm, expectedConfiguration));
219.Execute("pack", testAsset.Path)
227.Execute(property == PublishRelease ? "publish" : "pack", testAsset.Path)
234finalPropertyResults.Add(testProject.GetPropertyValues(testAsset.Path, testProject == testProjects[0] ? firstProjectTfm : secondProjectTfm, expectedConfiguration));
255.Execute(testAsset.Path)
272.Execute(testAsset.Path)
289.Execute(testAsset.Path)
305.Execute("dotnet", pReleaseVar == PublishRelease ? "publish" : "pack", testAsset.Path)
319.WithWorkingDirectory(Directory.GetParent(testAsset.Path).FullName) // code under test looks in CWD, ensure coverage outside this scenario
320.Execute(testAsset.Path)
336.Execute(testAsset.Path) // This property won't be set in VS, make sure the error doesn't occur because of this by mimicking behavior.
343finalPropertyResults.Add(testProject.GetPropertyValues(testAsset.Path, tfm, expectedConfiguration));
Microsoft.NET.Rebuild.Tests (1)
Microsoft.NET.Restore.Tests (18)
GivenThatWeWantToUseFrameworkRoslyn.cs (10)
29NuGetConfigWriter.Write(testAsset.Path, TestContext.Current.TestPackages);
31var customPackagesDir = Path.Combine(testAsset.Path, "nuget-packages");
68NuGetConfigWriter.Write(testAsset.Path, TestContext.Current.TestPackages);
70var customPackagesDir = Path.Combine(testAsset.Path, "nuget-packages");
125var customPackagesDir = Path.Combine(testAsset.Path, "nuget-packages");
156NuGetConfigWriter.Write(testAsset.Path, TestContext.Current.TestPackages);
158var customPackagesDir = Path.Combine(testAsset.Path, "nuget-packages");
179NuGetConfigWriter.Write(testAsset.Path, TestContext.Current.TestPackages);
183WorkingDirectory = Path.Combine(testAsset.Path, "FxWpf")
191Assert.True(File.Exists(Path.Combine(testAsset.Path, "obj", "net472", "MainWindow.g.cs")));
Microsoft.Net.Sdk.AnalyzerRedirecting.Tests (6)
Microsoft.NET.Sdk.BlazorWebAssembly.AoT.Tests (1)
Microsoft.NET.Sdk.BlazorWebAssembly.Tests (12)
BlazorLegacyIntegrationTest50.cs (3)
24var clientBuildOutputDirectory = Path.Combine(testInstance.Path, "Client", "bin", "Debug", targetFramework);
33var serverBuildOutputDirectory = Path.Combine(testInstance.Path, "Server", "bin", "Debug", targetFramework);
39var serverIntermediateDirectory = Path.Combine(testInstance.Path, "Server", "obj", "Debug", targetFramework, "staticwebassets");
Microsoft.NET.Sdk.Publish.Tasks.Tests (1)
Microsoft.NET.Sdk.Razor.Tests (22)
BuildIncrementalismTest.cs (4)
22var indexPage = Path.Combine(projectDirectory.Path, "Views", "Home", "Index.cshtml");
86var page = Path.Combine(projectDirectory.Path, "Views", "Shared", "NavMenu.razor");
113Directory.Delete(Path.Combine(projectDirectory.Path, "Components"), recursive: true);
148File.AppendAllText(Path.Combine(projectDirectory.Path, "Views", "_ViewImports.cshtml"), Environment.NewLine);
PackIntegrationTest.cs (4)
33Path.Combine(projectDirectory.Path, "obj", "Debug", "ClassLibrary.1.0.0.nuspec"),
38Path.Combine(projectDirectory.Path, "obj", "Debug", "ClassLibrary.1.0.0.nuspec"),
43Path.Combine(projectDirectory.Path, "obj", "Debug", "ClassLibrary.1.0.0.nuspec"),
48Path.Combine(projectDirectory.Path, "obj", "Debug", "ClassLibrary.1.0.0.nuspec"),
Microsoft.NET.Sdk.Razor.Tool.Tests (35)
Microsoft.NET.Sdk.StaticWebAssets.Tests (198)
ScopedCssIntegrationTests.cs (12)
82var stylesFolder = Path.Combine(projectDirectory.Path, "Styles", "Pages");
85File.Move(Path.Combine(projectDirectory.Path, "Components", "Pages", "Counter.razor.css"), styles);
277File.Delete(Path.Combine(projectDirectory.Path, "Components", "Pages", "Counter.razor.css"));
278File.Delete(Path.Combine(projectDirectory.Path, "Components", "Pages", "Index.razor.css"));
327File.Delete(Path.Combine(projectDirectory.Path, "Components", "Pages", "Counter.razor.css"));
348File.Delete(Path.Combine(projectDirectory.Path, "Components", "Pages", "Counter.razor.css"));
349File.Delete(Path.Combine(projectDirectory.Path, "Components", "Pages", "Index.razor.css"));
591var scopedCssFile = Path.Combine(ProjectDirectory.Path, "AppWithPackageAndP2PReference", "Index.razor.css");
593File.WriteAllText(Path.Combine(ProjectDirectory.Path, "AppWithPackageAndP2PReference", "Index.razor"), "This is a test razor component.");
629var originalLibPath = Path.Combine(ProjectDirectory.Path, "AnotherClassLib");
630var newLibPath = Path.Combine(ProjectDirectory.Path, "项目");
651var mainProjectFile = Path.Combine(ProjectDirectory.Path, "AppWithPackageAndP2PReference", "AppWithPackageAndP2PReference.csproj");
StaticWebAssetsCompressionIntegrationTest.cs (6)
21var file = Path.Combine(ProjectDirectory.Path, "ClassLibrary", "wwwroot", "js", "project-transitive-dep.js");
22var gzipFile = Path.Combine(ProjectDirectory.Path, "ClassLibrary", "wwwroot", "js", "project-transitive-dep.js.gz");
23var brotliFile = Path.Combine(ProjectDirectory.Path, "ClassLibrary", "wwwroot", "js", "project-transitive-dep.js.br");
136var file = Path.Combine(ProjectDirectory.Path, "ClassLibrary", "wwwroot", "js", "project-transitive-dep.js");
137var gzipFile = Path.Combine(ProjectDirectory.Path, "ClassLibrary", "wwwroot", "js", "project-transitive-dep.js.gz");
138var brotliFile = Path.Combine(ProjectDirectory.Path, "ClassLibrary", "wwwroot", "js", "project-transitive-dep.js.br");
StaticWebAssetsDesignTimeTest.cs (7)
33File.WriteAllText(Path.Combine(ProjectDirectory.Path, "ClassLibrary", "wwwroot", "js", "file.js"), "New File");
47inputFiles.Should().Contain(Path.Combine(ProjectDirectory.Path, "ClassLibrary", "wwwroot", "js", "file.js"));
48inputFiles.Should().Contain(Path.Combine(ProjectDirectory.Path, "ClassLibrary", "wwwroot", "js", "project-transitive-dep.js"));
49inputFiles.Should().Contain(Path.Combine(ProjectDirectory.Path, "ClassLibrary", "wwwroot", "js", "project-transitive-dep.v4.js"));
69File.Delete(Path.Combine(ProjectDirectory.Path, "ClassLibrary", "wwwroot", "js", "project-transitive-dep.js"));
84inputFiles.Should().Contain(Path.Combine(ProjectDirectory.Path, "ClassLibrary", "wwwroot", "js", "project-transitive-dep.v4.js"));
117inputFiles.Should().Contain(Path.Combine(ProjectDirectory.Path, "ClassLibrary", "obj", "Debug", DefaultTfm, "staticwebassets.build.json"));
StaticWebAssetsIntegrationTest.cs (10)
161Directory.CreateDirectory(Path.Combine(ProjectDirectory.Path, "wwwroot"));
162File.WriteAllText(Path.Combine(ProjectDirectory.Path, "wwwroot", "index.html"), "some html");
458var clean = new CleanCommand(Log, ProjectDirectory.Path);
596Directory.CreateDirectory(Path.Combine(ProjectDirectory.Path, "wwwroot"));
597File.WriteAllText(Path.Combine(ProjectDirectory.Path, "wwwroot", "file.build.txt"), "file1");
598File.WriteAllText(Path.Combine(ProjectDirectory.Path, "wwwroot", "file.publish.txt"), "file1");
631Directory.CreateDirectory(Path.Combine(ProjectDirectory.Path, "AppWithPackageAndP2PReference", "wwwroot", "_content", "ClassLibrary", "js"));
632File.WriteAllText(Path.Combine(ProjectDirectory.Path, "AppWithPackageAndP2PReference", "wwwroot", "_content", "ClassLibrary", "js", "project-transitive-dep.js"), "console.log('transitive-dep');");
948var intermediateOutputPath = Path.Combine(ProjectDirectory.Path, "AppWithPackageAndP2PReference", "obj", "Debug");
949var publishPath = Path.Combine(ProjectDirectory.Path, "AppWithPackageAndP2PReference", "bin", "Debug", "publish");
StaticWebAssetsPackIntegrationTest.cs (158)
30Directory.CreateDirectory(Path.Combine(projectDirectory.Path, "bundle", "js"));
31File.WriteAllText(Path.Combine(projectDirectory.Path, "bundle", "js", "pkg-direct-dep.js"), "console.log('bundle');");
117Path.Combine(projectDirectory.Path, "bin", "Debug", "PackageLibraryNoStaticAssets.1.0.0.nupkg"),
168File.WriteAllText(Path.Combine(projectDirectory.Path, "PackageLibraryDirectDependency", "wwwroot", "LICENSE"), "license file contents");
210Directory.Delete(Path.Combine(projectDirectory.Path, "PackageLibraryDirectDependency", "Components"), recursive: true);
222Path.Combine(projectDirectory.Path, "PackageLibraryDirectDependency", "bin", "Debug", "PackageLibraryDirectDependency.1.0.0.nupkg"),
250Directory.Delete(Path.Combine(projectDirectory.Path, "PackageLibraryDirectDependency", "Components"), recursive: true);
265Path.Combine(projectDirectory.Path, "PackageLibraryDirectDependency", "bin", "Debug", "PackageLibraryDirectDependency.1.0.0.nupkg"),
293Directory.Delete(Path.Combine(projectDirectory.Path, "PackageLibraryDirectDependency", "Components"), recursive: true);
308Path.Combine(projectDirectory.Path, "PackageLibraryDirectDependency", "bin", "Debug", "PackageLibraryDirectDependency.1.0.0.nupkg"),
334Directory.Delete(Path.Combine(projectDirectory.Path, "PackageLibraryDirectDependency", "Components"), recursive: true);
346Path.Combine(projectDirectory.Path, "PackageLibraryDirectDependency", "bin", "Debug", "PackageLibraryDirectDependency.1.0.0.nupkg"),
374Directory.Delete(Path.Combine(projectDirectory.Path, "PackageLibraryDirectDependency", "Components"), recursive: true);
386Path.Combine(projectDirectory.Path, "PackageLibraryDirectDependency", "bin", "Debug", "PackageLibraryDirectDependency.1.0.0.nupkg"),
421Directory.Delete(Path.Combine(projectDirectory.Path, "wwwroot"), recursive: true);
428Directory.CreateDirectory(Path.Combine(projectDirectory.Path, "wwwroot"));
429File.WriteAllText(Path.Combine(projectDirectory.Path, "_Imports.razor"), "@using Microsoft.AspNetCore.Components.Web" + Environment.NewLine);
430File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor"), componentText);
431File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor.css"), "");
432File.WriteAllText(Path.Combine(projectDirectory.Path, "ExampleJsInterop.cs"), "");
433File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "background.png"), "");
434File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "exampleJsInterop.js"), "");
446projectDirectory.Path,
490Directory.Delete(Path.Combine(projectDirectory.Path, "wwwroot"), recursive: true);
497Directory.CreateDirectory(Path.Combine(projectDirectory.Path, "wwwroot"));
498File.WriteAllText(Path.Combine(projectDirectory.Path, "_Imports.razor"), "@using Microsoft.AspNetCore.Components.Web" + Environment.NewLine);
499File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor"), componentText);
500File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor.css"), "");
501File.WriteAllText(Path.Combine(projectDirectory.Path, "ExampleJsInterop.cs"), "");
502File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "background.png"), "");
503File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "exampleJsInterop.js"), "");
515projectDirectory.Path,
558Directory.Delete(Path.Combine(projectDirectory.Path, "wwwroot"), recursive: true);
565Directory.CreateDirectory(Path.Combine(projectDirectory.Path, "wwwroot"));
566File.WriteAllText(Path.Combine(projectDirectory.Path, "_Imports.razor"), "@using Microsoft.AspNetCore.Components.Web" + Environment.NewLine);
567File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor"), componentText);
568File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor.css"), "");
569File.WriteAllText(Path.Combine(projectDirectory.Path, "ExampleJsInterop.cs"), "");
570File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "background.png"), "");
571File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "exampleJsInterop.js"), "");
588projectDirectory.Path,
632Directory.Delete(Path.Combine(projectDirectory.Path, "wwwroot"), recursive: true);
639Directory.CreateDirectory(Path.Combine(projectDirectory.Path, "wwwroot"));
640File.WriteAllText(Path.Combine(projectDirectory.Path, "_Imports.razor"), "@using Microsoft.AspNetCore.Components.Web" + Environment.NewLine);
641File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor"), componentText);
642File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor.css"), "");
643File.WriteAllText(Path.Combine(projectDirectory.Path, "ExampleJsInterop.cs"), "");
644File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "background.png"), "");
645File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "exampleJsInterop.js"), "");
662projectDirectory.Path,
705Directory.Delete(Path.Combine(projectDirectory.Path, "wwwroot"), recursive: true);
712Directory.CreateDirectory(Path.Combine(projectDirectory.Path, "wwwroot"));
713File.WriteAllText(Path.Combine(projectDirectory.Path, "_Imports.razor"), "@using Microsoft.AspNetCore.Components.Web" + Environment.NewLine);
714File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor"), componentText);
715File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor.css"), "");
716File.WriteAllText(Path.Combine(projectDirectory.Path, "ExampleJsInterop.cs"), "");
717File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "background.png"), "");
718File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "exampleJsInterop.js"), "");
730projectDirectory.Path,
774Directory.Delete(Path.Combine(projectDirectory.Path, "wwwroot"), recursive: true);
781Directory.CreateDirectory(Path.Combine(projectDirectory.Path, "wwwroot"));
782File.WriteAllText(Path.Combine(projectDirectory.Path, "_Imports.razor"), "@using Microsoft.AspNetCore.Components.Web" + Environment.NewLine);
783File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor"), componentText);
784File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor.css"), "");
785File.WriteAllText(Path.Combine(projectDirectory.Path, "ExampleJsInterop.cs"), "");
786File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "background.png"), "");
787File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "exampleJsInterop.js"), "");
799projectDirectory.Path,
840Directory.Delete(Path.Combine(projectDirectory.Path, "wwwroot"), recursive: true);
847Directory.CreateDirectory(Path.Combine(projectDirectory.Path, "wwwroot"));
848File.WriteAllText(Path.Combine(projectDirectory.Path, "_Imports.razor"), "@using Microsoft.AspNetCore.Components.Web" + Environment.NewLine);
849File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor"), componentText);
850File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor.css"), "");
851File.WriteAllText(Path.Combine(projectDirectory.Path, "ExampleJsInterop.cs"), "");
852File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "background.png"), "");
853File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "exampleJsInterop.js"), "");
865projectDirectory.Path,
907Directory.Delete(Path.Combine(projectDirectory.Path, "wwwroot"), recursive: true);
914Directory.CreateDirectory(Path.Combine(projectDirectory.Path, "wwwroot"));
915File.WriteAllText(Path.Combine(projectDirectory.Path, "_Imports.razor"), "@using Microsoft.AspNetCore.Components.Web" + Environment.NewLine);
916File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor"), componentText);
917File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor.css"), "");
918File.WriteAllText(Path.Combine(projectDirectory.Path, "ExampleJsInterop.cs"), "");
919File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "background.png"), "");
920File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "exampleJsInterop.js"), "");
932projectDirectory.Path,
973Directory.Delete(Path.Combine(projectDirectory.Path, "wwwroot"), recursive: true);
980Directory.CreateDirectory(Path.Combine(projectDirectory.Path, "wwwroot"));
981File.WriteAllText(Path.Combine(projectDirectory.Path, "_Imports.razor"), "@using Microsoft.AspNetCore.Components.Web" + Environment.NewLine);
982File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor"), componentText);
983File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor.css"), "");
984File.WriteAllText(Path.Combine(projectDirectory.Path, "ExampleJsInterop.cs"), "");
985File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "background.png"), "");
986File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "exampleJsInterop.js"), "");
1003projectDirectory.Path,
1045Directory.Delete(Path.Combine(projectDirectory.Path, "wwwroot"), recursive: true);
1052Directory.CreateDirectory(Path.Combine(projectDirectory.Path, "wwwroot"));
1053File.WriteAllText(Path.Combine(projectDirectory.Path, "_Imports.razor"), "@using Microsoft.AspNetCore.Components.Web" + Environment.NewLine);
1054File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor"), componentText);
1055File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor.css"), "");
1056File.WriteAllText(Path.Combine(projectDirectory.Path, "ExampleJsInterop.cs"), "");
1057File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "background.png"), "");
1058File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "exampleJsInterop.js"), "");
1075projectDirectory.Path,
1116Directory.Delete(Path.Combine(projectDirectory.Path, "wwwroot"), recursive: true);
1123Directory.CreateDirectory(Path.Combine(projectDirectory.Path, "wwwroot"));
1124File.WriteAllText(Path.Combine(projectDirectory.Path, "_Imports.razor"), "@using Microsoft.AspNetCore.Components.Web" + Environment.NewLine);
1125File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor"), componentText);
1126File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor.css"), "");
1127File.WriteAllText(Path.Combine(projectDirectory.Path, "ExampleJsInterop.cs"), "");
1128File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "background.png"), "");
1129File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "exampleJsInterop.js"), "");
1141projectDirectory.Path,
1183Directory.Delete(Path.Combine(projectDirectory.Path, "wwwroot"), recursive: true);
1190Directory.CreateDirectory(Path.Combine(projectDirectory.Path, "wwwroot"));
1191File.WriteAllText(Path.Combine(projectDirectory.Path, "_Imports.razor"), "@using Microsoft.AspNetCore.Components.Web" + Environment.NewLine);
1192File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor"), componentText);
1193File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor.css"), "");
1194File.WriteAllText(Path.Combine(projectDirectory.Path, "ExampleJsInterop.cs"), "");
1195File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "background.png"), "");
1196File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "exampleJsInterop.js"), "");
1208projectDirectory.Path,
1253Directory.Delete(Path.Combine(projectDirectory.Path, "wwwroot"), recursive: true);
1260Directory.CreateDirectory(Path.Combine(projectDirectory.Path, "wwwroot"));
1261File.WriteAllText(Path.Combine(projectDirectory.Path, "_Imports.razor"), "@using Microsoft.AspNetCore.Components.Web" + Environment.NewLine);
1262File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor"), componentText);
1263File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor.css"), "");
1264File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor.js"), "");
1265File.WriteAllText(Path.Combine(projectDirectory.Path, "ExampleJsInterop.cs"), "");
1266File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "background.png"), "");
1267File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "PackageLibraryTransitiveDependency.lib.module.js"), "");
1268File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "exampleJsInterop.js"), "");
1280projectDirectory.Path,
1328Directory.Delete(Path.Combine(projectDirectory.Path, "wwwroot"), recursive: true);
1335Directory.CreateDirectory(Path.Combine(projectDirectory.Path, "wwwroot"));
1336File.WriteAllText(Path.Combine(projectDirectory.Path, "_Imports.razor"), "@using Microsoft.AspNetCore.Components.Web" + Environment.NewLine);
1337File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor"), componentText);
1338File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor.css"), "");
1339File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor.js"), "");
1340File.WriteAllText(Path.Combine(projectDirectory.Path, "ExampleJsInterop.cs"), "");
1341File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "background.png"), "");
1342File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "PackageLibraryTransitiveDependency.lib.module.js"), "");
1343File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "exampleJsInterop.js"), "");
1357projectDirectory.Path,
1405Directory.Delete(Path.Combine(projectDirectory.Path, "wwwroot"), recursive: true);
1412Directory.CreateDirectory(Path.Combine(projectDirectory.Path, "wwwroot"));
1413File.WriteAllText(Path.Combine(projectDirectory.Path, "_Imports.razor"), "@using Microsoft.AspNetCore.Components.Web" + Environment.NewLine);
1414File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor"), componentText);
1415File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor.css"), "");
1416File.WriteAllText(Path.Combine(projectDirectory.Path, "ExampleJsInterop.cs"), "");
1417File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "background.png"), "");
1418File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "exampleJsInterop.js"), "");
1430projectDirectory.Path,
1460Directory.Delete(Path.Combine(projectDirectory.Path, "PackageLibraryDirectDependency", "Components"), recursive: true);
1472Path.Combine(projectDirectory.Path, "PackageLibraryDirectDependency", "bin", "Debug", "PackageLibraryDirectDependency.1.0.0.nupkg"),
1612Path.Combine(projectDirectory.Path, "bin", "Debug", "ComponentLibrary.1.0.0.nupkg"),
1675File.WriteAllText(Path.Combine(projectDirectory.Path, "PackageLibraryDirectDependency", "wwwroot", "LICENSE"), "license file contents");
1706File.WriteAllText(Path.Combine(projectDirectory.Path, "PackageLibraryDirectDependency", "wwwroot", "LICENSE"), "license file contents");
Microsoft.NET.Sdk.Web.Tests (1)
Microsoft.NET.Sdk.WorkloadManifestReader.Tests (5)
Microsoft.NET.TestFramework (9)
Microsoft.NET.ToolPack.Tests (4)
Microsoft.TemplateEngine.Cli.UnitTests (1)
Microsoft.WebTools.AspireService.Tests (1)
Microsoft.Win32.Msi.Tests (1)
msbuild.Integration.Tests (7)
sdk-tasks.Tests (1)
System.CommandLine.StaticCompletions.Tests (1)
trustedroots.Tests (1)