1 write to Path
Microsoft.NET.TestFramework (1)
TestDirectory.cs (1)
15Path = path;
1864 references to Path
ArgumentForwarding.Tests (1)
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
containerize.UnitTests (1)
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
dotnet.Tests (1070)
CommandFactoryTests\GivenAProjectDependencyCommandResolver.cs (12)
31NuGetConfigWriter.Write(testAsset.Path, TestContext.Current.TestPackages); 34.WithWorkingDirectory(testAsset.Path) 44ProjectDirectory = testAsset.Path, 66NuGetConfigWriter.Write(testAsset.Path, TestContext.Current.TestPackages); 69.WithWorkingDirectory(testAsset.Path) 79ProjectDirectory = testAsset.Path, 97NuGetConfigWriter.Write(testAsset.Path, TestContext.Current.TestPackages); 110ProjectDirectory = testAsset.Path, 126NuGetConfigWriter.Write(testAsset.Path, TestContext.Current.TestPackages); 135var outputDir = Path.Combine(testAsset.Path, "out"); 141ProjectDirectory = testAsset.Path, 147.WithWorkingDirectory(testAsset.Path)
CommandFactoryTests\GivenAProjectToolsCommandResolver.cs (19)
72ProjectDirectory = projectDirectory.Path 88NuGetConfigWriter.Write(testInstance.Path, TestContext.Current.TestPackages); 96ProjectDirectory = testInstance.Path 112NuGetConfigWriter.Write(testInstance.Path, TestContext.Current.TestPackages); 120ProjectDirectory = testInstance.Path 142NuGetConfigWriter.Write(testInstance.Path, TestContext.Current.TestPackages); 150ProjectDirectory = testInstance.Path 167NuGetConfigWriter.Write(testInstance.Path, TestContext.Current.TestPackages); 175ProjectDirectory = testInstance.Path 194NuGetConfigWriter.Write(testInstance.Path, TestContext.Current.TestPackages); 202ProjectDirectory = testInstance.Path 222NuGetConfigWriter.Write(testInstance.Path, TestContext.Current.TestPackages); 230ProjectDirectory = testInstance.Path 268NuGetConfigWriter.Write(testInstance.Path, TestContext.Current.TestPackages); 305NuGetConfigWriter.Write(testInstance.Path, TestContext.Current.TestPackages); 313ProjectDirectory = testInstance.Path 331var testProjectDirectory = testInstance.Path; 356var testProjectDirectory = testInstance.Path; 400var nugetConfig = Path.Combine(testInstance.Path, "NuGet.Config");
CommandTests\Build\GivenDotnetBuildBuildsCsproj.cs (17)
23var buildCommand = new DotnetBuildCommand(Log, testInstance.Path); 31var outputPathCalculator = OutputPathCalculator.FromProject(testInstance.Path); 49new DotnetBuildCommand(Log, testInstance.Path) 64new DotnetBuildCommand(Log, testInstance.Path) 77string projectDirectory = Path.Combine(testInstance.Path, "MultiTFMTestApp"); 92.WithWorkingDirectory(testInstance.Path) 105string responseFilePath = Path.Combine(testInstance.Path, "Directory.Build.rsp"); 110.WithWorkingDirectory(testInstance.Path) 121var rootPath = testInstance.Path; 164.WithWorkingDirectory(testInstance.Path) 178.WithWorkingDirectory(testInstance.Path) 198.WithWorkingDirectory(testInstance.Path) 219.WithWorkingDirectory(Path.Combine(testInstance.Path, testProject.Name ?? string.Empty)) 238.WithWorkingDirectory(testInstance.Path) 255.WithWorkingDirectory(testInstance.Path) 310.WithWorkingDirectory(Path.Combine(testAsset.Path, testProject.Name ?? string.Empty)) 344NuGetConfigWriter.Write(testAsset.Path, TestContext.Current.TestPackages);
CommandTests\Build\GivenDotnetBuildBuildsDcproj.cs (1)
25.WithWorkingDirectory(testInstance.Path)
CommandTests\BuildServer\Shutdown\BuildServerShutdownCommandTests.cs (1)
165var pidDirectory = _testAssetsManager.CreateTestDirectory(identifier: "pidDirectory").Path;
CommandTests\Clean\GivenDotnetCleanCleansBuildArtifacts.cs (3)
19new DotnetBuildCommand(Log, testInstance.Path) 24var outputFolder = new DirectoryInfo(OutputPathCalculator.FromProject(testInstance.Path).GetOutputDirectory(configuration: configuration, runtimeIdentifier: $"{ToolsetInfo.LatestWinRuntimeIdentifier}-x64")); 28new DotnetCommand(Log, "clean", testInstance.Path)
CommandTests\Hidden\Complete\CompleteCommandTests.cs (4)
347Directory.SetCurrentDirectory(testAsset.Path); 369Directory.SetCurrentDirectory(testAsset.Path); 392Directory.SetCurrentDirectory(testAsset.Path); 418Directory.SetCurrentDirectory(testAsset.Path);
CommandTests\MSBuild\GivenDotnetMSBuildBuildsProjects.cs (4)
24var testProjectDirectory = testInstance.Path; 61.WithWorkingDirectory(projectDirectory.Path) 84var root = testInstance.Path; 103.WithWorkingDirectory(projectDirectory.Path)
CommandTests\MSBuild\GivenDotnetOsArchOptions.cs (2)
122.WithWorkingDirectory(testInstance.Path) 139.WithWorkingDirectory(testInstance.Path)
CommandTests\MSBuild\GivenDotnetRunInvocation.cs (1)
35var newWorkingDir = tam.CopyTestAsset("HelloWorld", identifier: $"{nameof(MsbuildInvocationIsCorrect)}_{args.GetHashCode()}_{expectedArgs.GetHashCode()}").WithSource().Path;
CommandTests\NuGet\GivenANuGetCommand.cs (3)
104var rootPath = _testAssetsManager.CreateTestDirectory().Path; 122var projectDirectory = testAsset.Path; 147var projectDirectory = testAsset.Path;
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; 297var file = Path.Join(testInstance.Path, "Program.cs"); 303.WithWorkingDirectory(testInstance.Path) 321var file = Path.Join(testInstance.Path, "Program.cs"); 328.WithWorkingDirectory(testInstance.Path) 347var file = Path.Join(testInstance.Path, "Program.cs"); 355.WithWorkingDirectory(testInstance.Path) 384var file = Path.Join(testInstance.Path, "Program.cs"); 392.WithWorkingDirectory(testInstance.Path) 407var file = Path.Join(testInstance.Path, "Program.cs"); 413.WithWorkingDirectory(testInstance.Path) 428var file = Path.Join(testInstance.Path, "Program.cs"); 435.WithWorkingDirectory(testInstance.Path) 447var file = Path.Join(testInstance.Path, "Program.cs"); 454.WithWorkingDirectory(testInstance.Path) 465var file = Path.Join(testInstance.Path, "Program.cs"); 471.WithWorkingDirectory(testInstance.Path) 486var file = Path.Join(testInstance.Path, "Program.cs"); 492var directoryPackagesProps = Path.Join(testInstance.Path, "Directory.Packages.props"); 502.WithWorkingDirectory(testInstance.Path) 528var file = Path.Join(testInstance.Path, "Program.cs"); 544var directoryPackagesProps = Path.Join(testInstance.Path, "Directory.Packages.props"); 557.WithWorkingDirectory(testInstance.Path) 589var file = Path.Join(testInstance.Path, "Program.cs"); 596var directoryPackagesProps = Path.Join(testInstance.Path, "Directory.Packages.props"); 606.WithWorkingDirectory(testInstance.Path) 631var file = Path.Join(testInstance.Path, "Program.cs"); 638var directoryPackagesProps = Path.Join(testInstance.Path, "Directory.Packages.props"); 652.WithWorkingDirectory(testInstance.Path)
CommandTests\Package\List\GivenDotnetListPackage.cs (14)
23var projectDirectory = testAsset.Path; 48var projectDirectory = testAsset.Path; 80var projectDirectory = testAsset.Path; 112var projectDirectory = testAsset.Path; 137.Path; 154.Path; 204var projectDirectory = Path.Combine(testAsset.Path, testProject.Name); 246var projectDirectory = testAsset.Path; 285var projectDirectory = testAsset.Path; 306var projectDirectory = testAsset.Path; 371var projectDirectory = testAsset.Path; 393var projectDirectory = testAsset.Path; 416var projectDirectory = testAsset.Path; 439var projectDirectory = testAsset.Path;
CommandTests\Package\Remove\GivenDotnetPackageRemove.cs (4)
14.WithSource().Path; 36.WithSource().Path; 59.Path; 74.Path;
CommandTests\Package\Remove\GivenDotnetRemovePackage.cs (7)
71.WithSource().Path; 93var file = Path.Join(testInstance.Path, "Program.cs"); 101.WithWorkingDirectory(testInstance.Path) 115var file = Path.Join(testInstance.Path, "Program.cs"); 126.WithWorkingDirectory(testInstance.Path) 143var file = Path.Join(testInstance.Path, "Program.cs"); 149.WithWorkingDirectory(testInstance.Path)
CommandTests\Project\Convert\DotnetProjectConvertTests.cs (112)
23var dotnetProjectConvert = Path.Join(testInstance.Path, "dotnetProjectConvert"); 46var dotnetNewConsole = Path.Join(testInstance.Path, "DotnetNewConsole"); 71var directoryPath = Path.Join(testInstance.Path, "MyApp"); 73File.WriteAllText(Path.Join(testInstance.Path, "MyApp.cs"), "Console.WriteLine();"); 76.WithWorkingDirectory(testInstance.Path) 81new DirectoryInfo(testInstance.Path) 90Directory.CreateDirectory(Path.Join(testInstance.Path, "MyApp")); 91File.WriteAllText(Path.Join(testInstance.Path, "MyApp.cs"), "Console.WriteLine();"); 94.WithWorkingDirectory(testInstance.Path) 98new DirectoryInfo(testInstance.Path) 102new DirectoryInfo(Path.Join(testInstance.Path, "MyApp")) 105new DirectoryInfo(Path.Join(testInstance.Path, "MyApp1")) 114var directoryPath = Path.Join(testInstance.Path, "SomeOutput"); 116File.WriteAllText(Path.Join(testInstance.Path, "MyApp.cs"), "Console.WriteLine();"); 119.WithWorkingDirectory(testInstance.Path) 124new DirectoryInfo(testInstance.Path) 133File.WriteAllText(Path.Join(testInstance.Path, "Program1.cs"), "Console.WriteLine(1);"); 134File.WriteAllText(Path.Join(testInstance.Path, "Program2.cs"), "Console.WriteLine(2);"); 137.WithWorkingDirectory(testInstance.Path) 141new DirectoryInfo(testInstance.Path) 145new DirectoryInfo(Path.Join(testInstance.Path, "Program1")) 156.WithWorkingDirectory(testInstance.Path) 161new DirectoryInfo(testInstance.Path) 171.WithWorkingDirectory(testInstance.Path) 174.And.HaveStdErrContaining(string.Format(CliCommandStrings.InvalidFilePath, Path.Join(testInstance.Path, "NotHere.cs"))); 176new DirectoryInfo(testInstance.Path) 184var filePath = Path.Join(testInstance.Path, "Program.vb"); 188.WithWorkingDirectory(testInstance.Path) 193new DirectoryInfo(testInstance.Path) 202File.WriteAllText(Path.Join(testInstance.Path, "Program.CS"), "Console.WriteLine();"); 205.WithWorkingDirectory(testInstance.Path) 209new DirectoryInfo(testInstance.Path) 213new DirectoryInfo(Path.Join(testInstance.Path, "Program")) 224File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), content); 227.WithWorkingDirectory(testInstance.Path) 231new DirectoryInfo(testInstance.Path) 235File.ReadAllText(Path.Join(testInstance.Path, "Program.cs")) 238new DirectoryInfo(Path.Join(testInstance.Path, "Program")) 242File.ReadAllText(Path.Join(testInstance.Path, "Program", "Program.cs")) 250var appDirectory = Path.Join(testInstance.Path, "app"); 255.WithWorkingDirectory(testInstance.Path) 259new DirectoryInfo(Path.Join(testInstance.Path, "app")) 263new DirectoryInfo(Path.Join(testInstance.Path, "app", "Program")) 275File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 278File.WriteAllText(Path.Join(testInstance.Path, "my.json"), ""); 279File.WriteAllText(Path.Join(testInstance.Path, "Resources.resx"), ""); 280File.WriteAllText(Path.Join(testInstance.Path, "Util.cs"), ""); 281Directory.CreateDirectory(Path.Join(testInstance.Path, "subdir")); 282File.WriteAllText(Path.Join(testInstance.Path, "subdir", "second.json"), ""); 285.WithWorkingDirectory(testInstance.Path) 289new DirectoryInfo(testInstance.Path) 293new DirectoryInfo(Path.Join(testInstance.Path, "Program")) 297new DirectoryInfo(Path.Join(testInstance.Path, "Program", "subdir")) 306File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 310File.WriteAllText(Path.Join(testInstance.Path, "my.json"), ""); 311File.WriteAllText(Path.Join(testInstance.Path, "Resources.resx"), ""); 312File.WriteAllText(Path.Join(testInstance.Path, "Util.cs"), ""); 315.WithWorkingDirectory(testInstance.Path) 319new DirectoryInfo(testInstance.Path) 323new DirectoryInfo(Path.Join(testInstance.Path, "Program")) 332File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 336File.WriteAllText(Path.Join(testInstance.Path, "my.json"), ""); 337File.WriteAllText(Path.Join(testInstance.Path, "Resources.resx"), ""); 338File.WriteAllText(Path.Join(testInstance.Path, "Util.cs"), ""); 341.WithWorkingDirectory(testInstance.Path) 345new DirectoryInfo(testInstance.Path) 349new DirectoryInfo(Path.Join(testInstance.Path, "Program")) 361File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 364File.WriteAllText(Path.Join(testInstance.Path, "my.json"), ""); 365File.WriteAllText(Path.Join(testInstance.Path, "Resources.resx"), ""); 366File.WriteAllText(Path.Join(testInstance.Path, "Util.cs"), ""); 367File.WriteAllText(Path.Join(testInstance.Path, "second.json"), ""); 369File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.targets"), """ 378.WithWorkingDirectory(testInstance.Path) 382new DirectoryInfo(testInstance.Path) 387new DirectoryInfo(Path.Join(testInstance.Path, "Program")) 396File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 399File.WriteAllText(Path.Join(testInstance.Path, "Util.cs"), """ 402File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), """ 413.WithWorkingDirectory(testInstance.Path) 420.WithWorkingDirectory(testInstance.Path) 424new DirectoryInfo(testInstance.Path) 429new DirectoryInfo(Path.Join(testInstance.Path, "Program")) 435.WithWorkingDirectory(testInstance.Path) 445var subdir = Path.Join(testInstance.Path, "subdir"); 453File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), """ 495var subdir = Path.Join(testInstance.Path, "subdir"); 500File.WriteAllText(Path.Join(testInstance.Path, "Util.cs"), """ 503File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), """ 551File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 554File.WriteAllText(Path.Join(testInstance.Path, "my.json"), ""); 555File.WriteAllText(Path.Join(testInstance.Path, "Resources.resx"), ""); 556File.WriteAllText(Path.Join(testInstance.Path, "Util.cs"), ""); 557File.WriteAllText(Path.Join(testInstance.Path, $"repo.{ext}"), ""); 560.WithWorkingDirectory(testInstance.Path) 564new DirectoryInfo(testInstance.Path) 568new DirectoryInfo(Path.Join(testInstance.Path, "Program")) 583var filePath = Path.Join(testInstance.Path, "Program.cs"); 587.WithWorkingDirectory(testInstance.Path) 592new DirectoryInfo(Path.Join(testInstance.Path)) 604var filePath = Path.Join(testInstance.Path, "Program.cs"); 608.WithWorkingDirectory(testInstance.Path) 614new DirectoryInfo(Path.Join(testInstance.Path)) 629File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), originalSource); 632.WithWorkingDirectory(testInstance.Path) 636new DirectoryInfo(testInstance.Path) 640File.ReadAllText(Path.Join(testInstance.Path, "Program.cs")) 643new DirectoryInfo(Path.Join(testInstance.Path, "Program")) 647File.ReadAllText(Path.Join(testInstance.Path, "Program", "Program.cs")) 650File.ReadAllText(Path.Join(testInstance.Path, "Program", "Program.csproj")) 783var libDir = Path.Join(testInstance.Path, "lib"); 789filePath: Path.Join(testInstance.Path, "app", "Program.cs"),
CommandTests\Publish\GivenDotnetPublishPublishesProjects.cs (16)
27var testProjectDirectory = testInstance.Path; 54var testProjectDirectory = testInstance.Path; 70string projectDirectory = Path.Combine(testInstance.Path, "MultiTFMTestApp"); 85var testProjectDirectory = testInstance.Path; 104var rootDir = testInstance.Path; 183.WithWorkingDirectory(Path.Combine(testAsset.Path, "MainProject")) 276var testProjectDirectory = testInstance.Path; 291var testProjectDirectory = testInstance.Path; 313var rootDir = testInstance.Path; 337var rootPath = testInstance.Path; 355var rootPath = testInstance.Path; 389var rootPath = testInstance.Path; 410.WithWorkingDirectory(testInstance.Path) 428var rootDir = testInstance.Path; 445File.WriteAllText(helloWorldAsset.Path + "/Directory.Build.props", "<Project><PropertyGroup><PublishRelease>true</PublishRelease></PropertyGroup></Project>"); 451var expectedAssetPath = Path.Combine(helloWorldAsset.Path, "bin", "Release");
CommandTests\Reference\Add\GivenDotnetAddReference.cs (3)
58.Path); 63return new ProjDir(_testAssetsManager.CreateTestDirectory(testName: callingMethod, identifier: identifier).Path); 197var invalidProjDirectory = Path.Combine(_testAssetsManager.CreateTestDirectory().Path, "InvalidProj");
CommandTests\Reference\List\GivenDotnetListReference.cs (5)
153var lib = NewLib(_testAssetsManager.CreateTestDirectory().Path); 170var testDirectory = _testAssetsManager.CreateTestDirectory().Path; 193var testDir = _testAssetsManager.CreateTestDirectory().Path; 214var testDir = _testAssetsManager.CreateTestDirectory().Path; 236.Path);
CommandTests\Reference\Remove\GivenDotnetRemoveP2P.cs (2)
58.Path); 63return new ProjDir(_testAssetsManager.CreateTestDirectory(testName: callingMethod, identifier: identifier).Path);
CommandTests\Restore\GivenThatIWantToRestoreApp.cs (5)
21var rootPath = _testAssetsManager.CreateTestDirectory(identifier: useStaticGraphEvaluation.ToString()).Path; 30.Path; 106.Path; 129var rootPath = _testAssetsManager.CreateTestDirectory(identifier: useStaticGraphEvaluation.ToString()).Path; 156var rootPath = _testAssetsManager.CreateTestDirectory().Path;
CommandTests\Run\GivenDotnetRootEnv.cs (1)
81return testAsset.Path;
CommandTests\Run\GivenDotnetRunBuildsCsProj.cs (61)
25var testProjectDirectory = testInstance.Path; 45var testProjectDirectory = testInstance.Path; 62string projectDirectory = Path.Combine(testInstance.Path, "MultiTFMTestApp"); 79.WithWorkingDirectory(testInstance.Path) 96var testProjectDirectory = testInstance.Path; 112var testProjectDirectory = testInstance.Path; 128var testProjectDirectory = testInstance.Path; 148.WithWorkingDirectory(testInstance.Path) 161var projectFile = Path.Combine(testInstance.Path, testAppName + ".csproj"); 164.WithWorkingDirectory(Directory.GetParent(testInstance.Path).FullName) 178var testProjectDirectory = testInstance.Path; 181.WithWorkingDirectory(Directory.GetParent(testInstance.Path).FullName) 195var projectFile = Path.Combine(testInstance.Path, testAppName + ".csproj"); 198.WithWorkingDirectory(Directory.GetParent(testInstance.Path).FullName) 221var rootPath = _testAssetsManager.CreateTestDirectory().Path; 257.WithWorkingDirectory(testInstance.Path) 270var testProjectDirectory = testInstance.Path; 287var testProjectDirectory = testInstance.Path; 304var testProjectDirectory = testInstance.Path; 321var testProjectDirectory = testInstance.Path; 338var testProjectDirectory = testInstance.Path; 355var testProjectDirectory = testInstance.Path; 372var testProjectDirectory = testInstance.Path; 382{Path.Join(testInstance.Path, "Properties", "launchSettings.json")} 383{Path.Join(testInstance.Path, "MSBuildTestApp.run.json")} 394var testProjectDirectory = testInstance.Path; 413var testProjectDirectory = testInstance.Path; 434var testProjectDirectory = testInstance.Path; 454var testProjectDirectory = testInstance.Path; 474var testProjectDirectory = testInstance.Path; 494var testProjectDirectory = testInstance.Path; 513var testProjectDirectory = testInstance.Path; 534var testProjectDirectory = testInstance.Path; 553var testProjectDirectory = testInstance.Path; 572var testProjectDirectory = testInstance.Path; 589var testProjectDirectory = testInstance.Path; 606var testProjectDirectory = testInstance.Path; 625var testProjectDirectory = testInstance.Path; 644var testProjectDirectory = testInstance.Path; 662var testProjectDirectory = testInstance.Path; 681.WithWorkingDirectory(testInstance.Path) 703.WithWorkingDirectory(testInstance.Path) 724.WithWorkingDirectory(testInstance.Path) 740.WithWorkingDirectory(testInstance.Path) 756.WithWorkingDirectory(testInstance.Path) 769.WithWorkingDirectory(testInstance.Path) 785.WithWorkingDirectory(testInstance.Path) 800.WithWorkingDirectory(testInstance.Path) 817.WithWorkingDirectory(testInstance.Path) 834.WithWorkingDirectory(testInstance.Path) 851.WithWorkingDirectory(testInstance.Path) 869.WithWorkingDirectory(testInstance.Path) 888.WithWorkingDirectory(testInstance.Path) 907.WithWorkingDirectory(testInstance.Path) 927.WithWorkingDirectory(testInstance.Path) 944.WithWorkingDirectory(testInstance.Path) 961.WithWorkingDirectory(testInstance.Path) 981.WithWorkingDirectory(testInstance.Path) 998.WithWorkingDirectory(testInstance.Path) 1010var nonExistentProject = Path.Combine(tempDir.Path, "nonexistent.csproj"); 1013.WithWorkingDirectory(tempDir.Path)
CommandTests\Run\GivenDotnetRunBuildsVbProj.cs (9)
22var testProjectDirectory = testInstance.Path; 32{Path.Join(testInstance.Path, "My Project", "launchSettings.json")} 33{Path.Join(testInstance.Path, "VBTestApp.run.json")} 45.WithWorkingDirectory(testInstance.Path) 66.WithWorkingDirectory(testInstance.Path) 84.WithWorkingDirectory(testInstance.Path) 101var testProjectDirectory = testInstance.Path; 121var testProjectDirectory = testInstance.Path; 142var testProjectDirectory = testInstance.Path;
CommandTests\Run\GivenDotnetRunIsInterrupted.cs (3)
29.WithWorkingDirectory(asset.Path); 90.WithWorkingDirectory(asset.Path); 151.WithWorkingDirectory(asset.Path);
CommandTests\Run\GivenDotnetRunUsesTargetExtension.cs (2)
24var testProjectDirectory = testInstance.Path; 50var testProjectDirectory = testInstance.Path;
CommandTests\Run\GivenThatWeCanPassNonProjectFilesToDotnetRun.cs (1)
20.Path;
CommandTests\Run\RunFileTests.cs (354)
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) 359.WithWorkingDirectory(testInstance.Path) 366.WithWorkingDirectory(testInstance.Path) 381File.WriteAllText(Path.Join(testInstance.Path, "test.dll"), """ 388.WithWorkingDirectory(testInstance.Path) 396.WithWorkingDirectory(testInstance.Path) 408File.WriteAllText(Path.Join(testInstance.Path, "complog"), """ 414.WithWorkingDirectory(testInstance.Path) 419.WithWorkingDirectory(testInstance.Path) 425.WithWorkingDirectory(testInstance.Path) 432.WithWorkingDirectory(testInstance.Path) 439.WithWorkingDirectory(testInstance.Path) 491.WithWorkingDirectory(testInstance.Path) 495.And.HaveStdErrContaining(string.Format(CliCommandStrings.RunCommandExceptionNoProjects, testInstance.Path, RunCommandParser.ProjectOption.Name)); 509File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 511path ??= testInstance.Path; 514.WithWorkingDirectory(testInstance.Path) 519testInstance.Path, 530File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 533.WithWorkingDirectory(testInstance.Path) 538testInstance.Path, 550File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 551File.WriteAllText(Path.Join(testInstance.Path, "App.csproj"), s_consoleProject); 554.WithWorkingDirectory(testInstance.Path) 567Directory.CreateDirectory(Path.Join(testInstance.Path, "file")); 568File.WriteAllText(Path.Join(testInstance.Path, "file", "Program.cs"), s_program); 569Directory.CreateDirectory(Path.Join(testInstance.Path, "proj")); 570File.WriteAllText(Path.Join(testInstance.Path, "proj", "App.csproj"), s_consoleProject); 573.WithWorkingDirectory(Path.Join(testInstance.Path, "proj")) 585Directory.CreateDirectory(Path.Join(testInstance.Path, "file")); 586File.WriteAllText(Path.Join(testInstance.Path, "file", "Program.cs"), s_program); 587Directory.CreateDirectory(Path.Join(testInstance.Path, "proj")); 588File.WriteAllText(Path.Join(testInstance.Path, "proj", "App.csproj"), s_consoleProject); 591.WithWorkingDirectory(Path.Join(testInstance.Path, "proj")) 610File.WriteAllText(Path.Join(testInstance.Path, fileName), """ 616.WithWorkingDirectory(testInstance.Path) 633File.WriteAllText(Path.Join(testInstance.Path, fileName), s_program); 636.WithWorkingDirectory(testInstance.Path) 641testInstance.Path, 649File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 650File.WriteAllText(Path.Join(testInstance.Path, "Program2.cs"), s_program); 653.WithWorkingDirectory(testInstance.Path) 659.WithWorkingDirectory(testInstance.Path) 674.WithWorkingDirectory(testInstance.Path) 679testInstance.Path, 690File.WriteAllText(Path.Join(testInstance.Path, "Util.cs"), s_util); 693.WithWorkingDirectory(testInstance.Path) 706File.WriteAllText(Path.Join(testInstance.Path, "Util.cs"), s_util); 709.WithWorkingDirectory(testInstance.Path) 714testInstance.Path, 725File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_programDependingOnUtil); 726File.WriteAllText(Path.Join(testInstance.Path, "Util.cs"), s_util); 729.WithWorkingDirectory(testInstance.Path) 735File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), $""" 741.WithWorkingDirectory(testInstance.Path) 756File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_programDependingOnUtil); 757File.WriteAllText(Path.Join(testInstance.Path, "Util.cs"), s_util); 760.WithWorkingDirectory(testInstance.Path) 782File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 783Directory.CreateDirectory(Path.Join(testInstance.Path, "nested")); 784File.WriteAllText(Path.Join(testInstance.Path, "nested", "App.csproj"), s_consoleProject); 787.WithWorkingDirectory(testInstance.Path) 801File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 802File.WriteAllText(Path.Join(testInstance.Path, "App.csproj"), s_consoleProject); 804var dirName = Path.GetFileName(testInstance.Path); 806var workDir = Path.GetDirectoryName(testInstance.Path)!; 825File.Delete(Path.Join(testInstance.Path, "MSBuildTestApp.csproj")); 828.WithWorkingDirectory(testInstance.Path) 841File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), string.Empty); 844.WithWorkingDirectory(testInstance.Path) 857File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 858File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), """ 867.WithWorkingDirectory(testInstance.Path) 877File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 878File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.targets"), """ 889.WithWorkingDirectory(testInstance.Path) 902File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 903File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.targets"), """ 912.WithWorkingDirectory(testInstance.Path) 932File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 935.WithWorkingDirectory(testInstance.Path) 951File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 954.WithWorkingDirectory(testInstance.Path) 959testInstance.Path, 970File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 977.WithWorkingDirectory(testInstance.Path) 994File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 1001.WithWorkingDirectory(testInstance.Path) 1006new DirectoryInfo(testInstance.Path) 1016File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 1023.WithWorkingDirectory(testInstance.Path) 1027new DirectoryInfo(testInstance.Path) 1045File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 1048.WithWorkingDirectory(testInstance.Path) 1055new DirectoryInfo(testInstance.Path) 1065File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 1068.WithWorkingDirectory(testInstance.Path) 1076new DirectoryInfo(testInstance.Path) 1086File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 1089.WithWorkingDirectory(testInstance.Path) 1094new DirectoryInfo(testInstance.Path) 1107File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 1110.WithWorkingDirectory(testInstance.Path) 1115new DirectoryInfo(testInstance.Path) 1128File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 1131.WithWorkingDirectory(testInstance.Path) 1136string binaryLogPath = Path.Join(testInstance.Path, "msbuild.binlog"); 1151var programFile = Path.Join(testInstance.Path, "Program.cs"); 1155.WithWorkingDirectory(testInstance.Path) 1176var programFile = Path.Join(testInstance.Path, "Program.cs"); 1180.WithWorkingDirectory(testInstance.Path) 1193var programFile = Path.Join(testInstance.Path, "Program.cs"); 1197.WithWorkingDirectory(testInstance.Path) 1209File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 1215.WithWorkingDirectory(testInstance.Path) 1222File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 1227.WithWorkingDirectory(testInstance.Path) 1242File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_programReadingEmbeddedResource); 1243File.WriteAllText(Path.Join(testInstance.Path, "Resources.resx"), s_resx); 1246.WithWorkingDirectory(testInstance.Path) 1254File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), $""" 1260.WithWorkingDirectory(testInstance.Path) 1278File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_programReadingEmbeddedResource); 1279File.WriteAllText(Path.Join(testInstance.Path, "Resources.resx"), s_resx); 1280File.WriteAllText(Path.Join(testInstance.Path, $"repo.{ext}"), ""); 1285.WithWorkingDirectory(testInstance.Path) 1295var programFile = Path.Join(testInstance.Path, "Program.cs"); 1304.WithWorkingDirectory(testInstance.Path) 1311.WithWorkingDirectory(testInstance.Path) 1317.WithWorkingDirectory(testInstance.Path) 1327var programFile = Path.Join(testInstance.Path, "Program.cs"); 1336.WithWorkingDirectory(testInstance.Path) 1343.WithWorkingDirectory(testInstance.Path) 1349.WithWorkingDirectory(testInstance.Path) 1354.WithWorkingDirectory(testInstance.Path) 1364File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), """ 1371var programFile = Path.Join(testInstance.Path, "Program.cs"); 1379.WithWorkingDirectory(testInstance.Path) 1388var programFile = Path.Join(testInstance.Path, "Program.cs"); 1399.WithWorkingDirectory(testInstance.Path) 1409var programFile = Path.Join(testInstance.Path, "Program.cs"); 1418.WithWorkingDirectory(testInstance.Path) 1425.WithWorkingDirectory(testInstance.Path) 1432.WithWorkingDirectory(testInstance.Path) 1439.WithWorkingDirectory(testInstance.Path) 1449var programFile = Path.Join(testInstance.Path, "Program.cs"); 1458.WithWorkingDirectory(testInstance.Path) 1465.WithWorkingDirectory(testInstance.Path) 1473.WithWorkingDirectory(testInstance.Path) 1480.WithWorkingDirectory(testInstance.Path) 1490var programFile = Path.Join(testInstance.Path, "Program.cs"); 1496var publishDir = Path.Join(testInstance.Path, "artifacts"); 1500.WithWorkingDirectory(testInstance.Path) 1521var programFile = Path.Join(testInstance.Path, "Program.cs"); 1527var publishDir = Path.Join(testInstance.Path, "artifacts"); 1531.WithWorkingDirectory(testInstance.Path) 1549var programFile = Path.Join(testInstance.Path, "Program.cs"); 1555File.WriteAllText(Path.Join(testInstance.Path, "config.json"), """ 1562var publishDir = Path.Join(testInstance.Path, "artifacts"); 1566.WithWorkingDirectory(testInstance.Path) 1580var programFile = Path.Join(testInstance.Path, "Program.cs"); 1586var publishDir = Path.Join(testInstance.Path, "artifacts"); 1590.WithWorkingDirectory(testInstance.Path) 1598new DirectoryInfo(testInstance.Path).File("msbuild.binlog").Should().Exist(); 1605var programFile = Path.Join(testInstance.Path, "MyCustomProgram.cs"); 1611var publishDir = Path.Join(testInstance.Path, "artifacts"); 1615.WithWorkingDirectory(testInstance.Path) 1628var programFile = Path.Join(testInstance.Path, "Program.cs"); 1631var customPublishDir = Path.Join(testInstance.Path, "custom-publish"); 1635.WithWorkingDirectory(testInstance.Path) 1648var programFile = Path.Join(testInstance.Path, "Program.cs"); 1649var publishDir = Path.Join(testInstance.Path, "directive-publish"); 1658.WithWorkingDirectory(testInstance.Path) 1671var subDir = Directory.CreateDirectory(Path.Combine(testInstance.Path, "subdir")); 1683.WithWorkingDirectory(testInstance.Path) 1687new DirectoryInfo(testInstance.Path).Sub("subdir").Sub("artifacts").Sub("Program") 1696var programFile = Path.Join(testInstance.Path, "MyFileBasedTool.cs"); 1707.WithWorkingDirectory(testInstance.Path) 1715var outputDir = Path.Join(testInstance.Path, "artifacts"); 1720.WithWorkingDirectory(testInstance.Path) 1730.WithWorkingDirectory(testInstance.Path) 1743var programFile = Path.Join(testInstance.Path, "MyFileBasedTool.cs"); 1752.WithWorkingDirectory(testInstance.Path) 1760var outputDir = Path.Join(testInstance.Path, "custom"); 1765.WithWorkingDirectory(testInstance.Path) 1774.WithWorkingDirectory(testInstance.Path) 1784var programFile = Path.Join(testInstance.Path, "Program.cs"); 1788.WithWorkingDirectory(testInstance.Path) 1800.WithWorkingDirectory(testInstance.Path) 1814var programFile = Path.Join(testInstance.Path, "Program.cs"); 1822.WithWorkingDirectory(testInstance.Path) 1836.WithWorkingDirectory(testInstance.Path) 1852File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program + """ 1856var fullPath = Path.Join(testInstance.Path, relativePath); 1865.WithWorkingDirectory(testInstance.Path) 1876.WithWorkingDirectory(testInstance.Path) 1885.WithWorkingDirectory(testInstance.Path) 1901File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program + """ 1905Directory.CreateDirectory(Path.Join(testInstance.Path, "Properties")); 1906string launchSettings = Path.Join(testInstance.Path, "Properties", "launchSettings.json"); 1908string runJson = Path.Join(testInstance.Path, "Program.run.json"); 1912.WithWorkingDirectory(testInstance.Path) 1922.WithWorkingDirectory(testInstance.Path) 1932.WithWorkingDirectory(testInstance.Path) 1953File.WriteAllText(Path.Join(testInstance.Path, "First.cs"), source); 1954File.WriteAllText(Path.Join(testInstance.Path, "First.run.json"), s_launchSettings.Replace("TestProfileMessage", "First")); 1955File.WriteAllText(Path.Join(testInstance.Path, "Second.cs"), source); 1956File.WriteAllText(Path.Join(testInstance.Path, "Second.run.json"), s_launchSettings.Replace("TestProfileMessage", "Second")); 1960.WithWorkingDirectory(testInstance.Path) 1969.WithWorkingDirectory(testInstance.Path) 1982File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 1989.WithWorkingDirectory(testInstance.Path) 1999File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 2006.WithWorkingDirectory(testInstance.Path) 2016File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 2025.WithWorkingDirectory(testInstance.Path) 2038File.WriteAllText(Path.Join(testInstance.Path, "Directory.Packages.props"), """ 2048File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 2057.WithWorkingDirectory(testInstance.Path) 2071File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 2081.WithWorkingDirectory(testInstance.Path) 2090File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 2096.WithWorkingDirectory(testInstance.Path) 2110var libDir = Path.Join(testInstance.Path, "Lib"); 2129var appDir = Path.Join(testInstance.Path, "App"); 2148File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 2154.WithWorkingDirectory(testInstance.Path) 2157.And.HaveStdErrContaining(DirectiveError(Path.Join(testInstance.Path, "Program.cs"), 1, CliCommandStrings.InvalidProjectDirective, 2158string.Format(CliStrings.CouldNotFindProjectOrDirectory, Path.Join(testInstance.Path, "wrong.csproj")))); 2160File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 2166.WithWorkingDirectory(testInstance.Path) 2169.And.HaveStdErrContaining(DirectiveError(Path.Join(testInstance.Path, "Program.cs"), 1, CliCommandStrings.InvalidProjectDirective, 2170string.Format(CliStrings.CouldNotFindProjectOrDirectory, Path.Join(testInstance.Path, "dir/")))); 2172Directory.CreateDirectory(Path.Join(testInstance.Path, "dir")); 2176.WithWorkingDirectory(testInstance.Path) 2179.And.HaveStdErrContaining(DirectiveError(Path.Join(testInstance.Path, "Program.cs"), 1, CliCommandStrings.InvalidProjectDirective, 2180string.Format(CliStrings.CouldNotFindAnyProjectInDirectory, Path.Join(testInstance.Path, "dir/")))); 2182File.WriteAllText(Path.Join(testInstance.Path, "dir", "proj1.csproj"), "<Project />"); 2183File.WriteAllText(Path.Join(testInstance.Path, "dir", "proj2.csproj"), "<Project />"); 2187.WithWorkingDirectory(testInstance.Path) 2190.And.HaveStdErrContaining(DirectiveError(Path.Join(testInstance.Path, "Program.cs"), 1, CliCommandStrings.InvalidProjectDirective, 2191string.Format(CliStrings.MoreThanOneProjectInDirectory, Path.Join(testInstance.Path, "dir/")))); 2204string entryPointPath = Path.Join(testInstance.Path, fileName); 2213.WithWorkingDirectory(testInstance.Path) 2219var msbuildCall = FindCompilerCall(Path.Join(testInstance.Path, "msbuild.binlog")); 2424.WithWorkingDirectory(testInstance.Path) 2481string entryPointPath = Path.Join(testInstance.Path, fileName); 2497.WithWorkingDirectory(testInstance.Path) 2510.WithWorkingDirectory(testInstance.Path) 2560File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 2565var artifactsDir = VirtualProjectBuildingCommand.GetArtifactsPath(Path.Join(testInstance.Path, "Program.cs")); 2575File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 2582File.WriteAllText(Path.Join(testInstance.Path, "Program2.cs"), "test"); 2587string buildPropsFile = Path.Join(testInstance.Path, "Directory.Build.props"); 2607string importedFile = Path.Join(testInstance.Path, "Settings.props"); 2669.WithWorkingDirectory(testInstance.Path) 2689.WithWorkingDirectory(testInstance.Path) 2694var binlogs = new DirectoryInfo(testInstance.Path) 2716File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 2719.WithWorkingDirectory(testInstance.Path) 2732File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_programReadingEmbeddedResource); 2733File.WriteAllText(Path.Join(testInstance.Path, "Resources.resx"), s_resx); 2738File.WriteAllText(Path.Join(testInstance.Path, "Resources.resx"), s_resx.Replace("TestValue", "UpdatedValue")); 2743File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), "//v2\n" + s_programReadingEmbeddedResource); 2755File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 2760var artifactsDir = VirtualProjectBuildingCommand.GetArtifactsPath(Path.Join(testInstance.Path, "Program.cs")); 2765File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 2786File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 2792.WithWorkingDirectory(testInstance.Path) 2800File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 2805.WithWorkingDirectory(testInstance.Path) 2821File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 2833.WithWorkingDirectory(testInstance.Path) 2842File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), "<Project />"); 2845.WithWorkingDirectory(testInstance.Path) 2872File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 2878var artifactsDir = VirtualProjectBuildingCommand.GetArtifactsPath(Path.Join(testInstance.Path, "Program.cs")); 2881File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), "<Project />"); 2884.WithWorkingDirectory(testInstance.Path) 2890File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), """ 2900File.Delete(Path.Join(testInstance.Path, "Directory.Build.props")); 2903.WithWorkingDirectory(testInstance.Path) 2918File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 2921var artifactsDir = VirtualProjectBuildingCommand.GetArtifactsPath(Path.Join(testInstance.Path, "Program.cs")); 2925.WithEnvironmentVariable("NUGET_PACKAGES", Path.Join(testInstance.Path, "packages")) 2926.WithWorkingDirectory(testInstance.Path) 2933.WithEnvironmentVariable("NUGET_PACKAGES", Path.Join(testInstance.Path, "packages")) 2934.WithWorkingDirectory(testInstance.Path) 2939File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 2944.WithEnvironmentVariable("NUGET_PACKAGES", Path.Join(testInstance.Path, "packages")) 2945.WithWorkingDirectory(testInstance.Path) 2960var programPath = Path.Join(testInstance.Path, programFileName); 2986var programPath = Path.Join(testInstance.Path, "Program.cs"); 3042var programPath = Path.Join(testInstance.Path, programFileName); 3063var libDir = Path.Join(testInstance.Path, "Lib"); 3084var appDir = Path.Join(testInstance.Path, "App"); 3126File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), $""" 3144var programPath = Path.Join(testInstance.Path, "Program.cs"); 3172var programPath = Path.Join(testInstance.Path, "Program.cs"); 3207var programPath = Path.Join(testInstance.Path, "Program.cs"); 3266<RuntimeHostConfigurationOption Include="EntryPointFileDirectoryPath" Value="{testInstance.Path}" /> 3282var programPath = Path.Join(testInstance.Path, "Program.cs"); 3330<RuntimeHostConfigurationOption Include="EntryPointFileDirectoryPath" Value="{testInstance.Path}" /> 3349var programPath = Path.Join(testInstance.Path, "Program.cs"); 3397<RuntimeHostConfigurationOption Include="EntryPointFileDirectoryPath" Value="{testInstance.Path}" /> 3433var programPath = Path.Join(testInstance.Path, "Program.cs"); 3460var filePath = Path.Join(testInstance.Path, "Program.cs"); 3475.WithWorkingDirectory(testInstance.Path) 3485File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """" 3491.WithWorkingDirectory(testInstance.Path) 3494.And.HaveStdOut($"EntryPointFileDirectoryPath: {testInstance.Path}"); 3502File.WriteAllText(Path.Join(testInstance.Path, fileName), """ 3507var relativePath = Path.GetRelativePath(Directory.GetCurrentDirectory(), Path.Join(testInstance.Path, fileName)); 3519var dirWithSpaces = Path.Join(testInstance.Path, "dir with spaces"); 3528.WithWorkingDirectory(testInstance.Path) 3539File.WriteAllText(Path.Join(testInstance.Path, fileName), """ 3545.WithWorkingDirectory(testInstance.Path) 3548.And.HaveStdOut($"EntryPointFileDirectoryPath: {testInstance.Path}"); 3556var filePath = Path.Join(testInstance.Path, unicodeFileName); 3563.WithWorkingDirectory(testInstance.Path) 3574File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 3577.WithWorkingDirectory(testInstance.Path) 3604File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 3606File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), """ 3621.WithWorkingDirectory(testInstance.Path) 3626File.WriteAllText(Path.Join(testInstance.Path, "Program.csproj"), s_consoleProject); 3629.WithWorkingDirectory(testInstance.Path) 3641var result = new DirectoryInfo(testInstance.Path) 3650File.Delete(Path.Join(testInstance.Path, file));
CommandTests\Run\RunParserTests.cs (1)
22var newWorkingDir = testAsset.Path;
CommandTests\Sdk\Check\GivenDotnetSdkCheck.cs (1)
196var dotnetRoot = _testAssetsManager.CreateTestDirectory().Path;
CommandTests\Solution\Add\GivenDotnetSlnAdd.cs (40)
119.Path; 141.Path; 167.Path; 185.Path; 204.Path; 226.Path; 262.Path; 305.Path; 338.Path; 364.Path; 393.Path; 422.Path; 450.Path; 477.Path; 520.Path; 555.Path; 575.Path; 623.Path; 658.Path; 702.Path; 723.Path; 747.Path; 785.Path; 812.Path; 843.Path; 863.Path; 886.Path; 911.Path; 936.Path; 961.Path; 984.Path; 1007.Path; 1031.Path; 1058.Path; 1086.Path; 1118.Path; 1146.Path; 1173.Path; 1283.Path; 1313.Path;
CommandTests\Solution\List\GivenDotnetSlnList.cs (10)
95.Path; 116.Path; 140.Path; 159.Path; 179.Path; 203.Path; 227.Path; 254.Path; 274.Path; 294.Path;
CommandTests\Solution\Migrate\GivenDotnetSlnMigrate.cs (1)
18.Path;
CommandTests\Solution\Remove\GivenDotnetSlnRemove.cs (23)
100.Path; 121.Path; 147.Path; 165.Path; 184.Path; 205.Path; 228.Path; 259.Path; 290.Path; 315.Path; 347.Path; 383.Path; 413.Path; 442.Path; 466.Path; 490.Path; 534.Path; 577.Path; 607.Path; 632.Path; 657.Path; 682.Path; 702.Path;
CommandTests\Store\GivenDotnetStoresAndPublishesProjects.cs (7)
25var testProjectDirectory = testInstance.Path; 29var profileProjectPath = _testAssetsManager.CopyTestAsset(profileProjectName).WithSource().Path; 76var testProjectDirectory = testInstance.Path; 77var profileProjectPath = _testAssetsManager.CopyTestAsset(profileProjectName).WithSource().Path; 113var testProjectDirectory = testInstance.Path; 118var profileProjectPath = _testAssetsManager.CopyTestAsset(profileProjectName).WithSource().Path; 122var profileProjectPath1 = _testAssetsManager.CopyTestAsset(profileProjectName1).WithSource().Path;
CommandTests\Test\GivenDotnetTestBuildsAndDiscoversTests.cs (7)
26.WithWorkingDirectory(testInstance.Path) 49.WithWorkingDirectory(testInstance.Path) 72.WithWorkingDirectory(testInstance.Path) 93.WithWorkingDirectory(testInstance.Path) 118.WithWorkingDirectory(testInstance.Path) 139.WithWorkingDirectory(testInstance.Path) 159.WithWorkingDirectory(testInstance.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\Test\GivenDotnetTestBuildsAndRunsHelp.cs (3)
25.WithWorkingDirectory(testInstance.Path) 49.WithWorkingDirectory(testInstance.Path) 74.WithWorkingDirectory(testInstance.Path)
CommandTests\Test\GivenDotnetTestBuildsAndRunsTestBasedOnGlobbingFilter.cs (5)
26var binDirectory = new FileInfo($"{testInstance.Path}{Path.DirectorySeparatorChar}bin").Directory; 30.WithWorkingDirectory(testInstance.Path) 66var binDirectory = new FileInfo($"{testInstance.Path}{Path.DirectorySeparatorChar}bin").Directory; 72.WithWorkingDirectory(testInstance.Path) 109.WithWorkingDirectory(testInstance.Path)
CommandTests\Test\GivenDotnetTestBuildsAndRunsTestfromCsproj.cs (13)
49var testProjectDirectory = testInstance.Path; 77var testProjectDirectory = testInstance.Path; 94var testProjectDirectory = testInstance.Path; 111var testProjectDirectory = testInstance.Path; 145.WithWorkingDirectory(testInstance.Path) 293.Path; 303pkgDir = _testAssetsManager.CreateTestDirectory(identifier: "pkgs").Path; 383var rootPath = testInstance.Path; 621var testProjectDirectory = testInstance.Path; 645var testProjectDirectory = testInstance.Path; 668var testProjectDirectory = testInstance.Path; 696var testProjectDirectory = testInstance.Path; 816var testProjectDirectory = testInstance.Path;
CommandTests\Test\GivenDotnetTestBuildsAndRunsTestFromCsprojForMultipleTFM.cs (4)
25.Path; 64var testProjectDirectory = testInstance.Path; 105var testProjectDirectory = testInstance.Path; 134string projectDirectory = Path.Combine(testInstance.Path, "XUnitProject");
CommandTests\Test\GivenDotnetTestBuildsAndRunsTestfromCsprojWithCorrectTestRunParameters.cs (1)
87var testProjectDirectory = testInstance.Path;
CommandTests\Test\GivenDotnetTestBuildsAndRunsTestFromDll.cs (3)
24var testRoot = testAsset.Path; 60var testRoot = testAsset.Path; 90var testRoot = testAsset.Path;
CommandTests\Test\GivenDotnetTestBuildsAndRunsTests.cs (22)
26.WithWorkingDirectory(testInstance.Path) 51.WithWorkingDirectory(testInstance.Path) 78.WithWorkingDirectory(testInstance.Path) 104.WithWorkingDirectory(testInstance.Path) 130File.Move(Path.Join(testInstance.Path, "Properties", "launchSettings.json"), Path.Join(testInstance.Path, "TestProjectWithLaunchSettings.run.json")); 134.WithWorkingDirectory(testInstance.Path) 162.WithWorkingDirectory(testInstance.Path) 181.WithWorkingDirectory(testInstance.Path) 201.WithWorkingDirectory(testInstance.Path) 226.WithWorkingDirectory(testInstance.Path) 256.WithWorkingDirectory(testInstance.Path) 276.WithWorkingDirectory(testInstance.Path) 296.WithWorkingDirectory(testInstance.Path) 316.WithWorkingDirectory(testInstance.Path) 336.WithWorkingDirectory(testInstance.Path) 362.WithWorkingDirectory(testInstance.Path) 390.WithWorkingDirectory(testInstance.Path) 416.WithWorkingDirectory(testInstance.Path) 436.WithWorkingDirectory(testInstance.Path) 450.WithWorkingDirectory(testInstance.Path) 489.WithWorkingDirectory(testInstance.Path)
CommandTests\Test\GivenDotnetTestBuildsAndRunsTestsForMultipleTFMs.cs (5)
29.WithWorkingDirectory(testInstance.Path) 69.WithWorkingDirectory(testInstance.Path) 117.WithWorkingDirectory(testInstance.Path) 157.WithWorkingDirectory(testInstance.Path) 185.WithWorkingDirectory(testInstance.Path)
CommandTests\Test\GivenDotnetTestBuildsAndRunsTestsWithArtifacts.cs (3)
25.WithWorkingDirectory(testInstance.Path) 59testInstance.UpdateProjectFileWithMSTestPackageVersion(Path.Combine($@"{testInstance.Path}{PathUtility.GetDirectorySeparatorChar()}TestProject", "TestProject.csproj"), msTestVersion); 62.WithWorkingDirectory(testInstance.Path)
CommandTests\Test\GivenDotnetTestBuildsAndRunsTestsWithDifferentOptions.cs (28)
28.WithWorkingDirectory(testInstance.Path) 47.WithWorkingDirectory(testInstance.Path) 67.WithWorkingDirectory(testInstance.Path) 85.WithWorkingDirectory($"{testInstance.Path}{Path.DirectorySeparatorChar}SolutionFilter") 104.WithWorkingDirectory(testInstance.Path) 123.WithWorkingDirectory(testInstance.Path) 144.WithWorkingDirectory(testInstance.Path) 164.WithWorkingDirectory(testInstance.Path) 184.WithWorkingDirectory(testInstance.Path) 204.WithWorkingDirectory(testInstance.Path) 223.WithWorkingDirectory(testInstance.Path) 243.WithWorkingDirectory(testInstance.Path) 271.WithWorkingDirectory(testInstance.Path) 291.WithWorkingDirectory(testInstance.Path) 309.WithWorkingDirectory(testInstance.Path) 329.WithWorkingDirectory(testInstance.Path) 350var binDirectory = new FileInfo($"{testInstance.Path}{Path.DirectorySeparatorChar}bin").Directory; 354.WithWorkingDirectory(testInstance.Path) 374.WithWorkingDirectory(testInstance.Path) 390.WithWorkingDirectory(testInstance.Path) 416.WithWorkingDirectory(testInstance.Path) 441.WithWorkingDirectory(testInstance.Path) 475.WithWorkingDirectory(testInstance.Path) 513.WithWorkingDirectory(testInstance.Path) 543.WithWorkingDirectory(testInstance.Path) 547Assert.True(File.Exists(Path.Combine(testInstance.Path, traceFile)), "Trace file should exist after test execution."); 561.WithWorkingDirectory(testInstance.Path) 565Assert.True(File.Exists(Path.Combine(testInstance.Path, traceFile)), "Trace file should exist after test execution.");
CommandTests\Test\GivenDotnetTestContainsEnvironmentVariables.cs (2)
36var testRoot = testAsset.Path; 65var testRoot = testAsset.Path;
CommandTests\Test\GivenDotnetTestContainsMSBuildParameters.cs (1)
29var testRoot = testAsset.Path;
CommandTests\Test\GivenDotnetTestForwardDotnetRootEnvironmentVariables.cs (1)
25var command = new DotnetTestCommand(Log, disableNewOutput: true).WithWorkingDirectory(testAsset.Path);
CommandTests\Test\GivenDotnetTestRunsConsoleAppWithoutHandshake.cs (1)
27.WithWorkingDirectory(testInstance.Path)
CommandTests\Test\GivenDotnetTestsRunsInDifferentCultures.cs (1)
25var command = new DotnetTestCommand(Log, disableNewOutput: true).WithWorkingDirectory(testAsset.Path).WithCulture(locale);
CommandTests\Test\GivenDotnetTestsRunsWithDifferentCultures.cs (1)
23.WithWorkingDirectory(testInstance.Path)
CommandTests\Test\TestCommandValidationTests.cs (9)
22var testFilePath = Path.Combine(testDir.Path, filename); 24File.WriteAllText(Path.Combine(testDir.Path, "global.json"), 34.WithWorkingDirectory(testDir.Path) 48var subDir = Path.Combine(testDir.Path, "test_directory"); 50File.WriteAllText(Path.Combine(testDir.Path, "global.json"), 60.WithWorkingDirectory(testDir.Path) 76var dllPath = Path.Combine(testDir.Path, "test.dll"); 78File.WriteAllText(Path.Combine(testDir.Path, "global.json"), 88.WithWorkingDirectory(testDir.Path)
CommandTests\Tool\Install\ToolInstallGlobalOrToolPathCommandTests.cs (5)
121nugetConfig: new FilePath(Path.Combine(testAsset.Path, "NuGet.config")), 122rootConfigDirectory: new DirectoryPath(testAsset.Path), 124var nuGetPackageDownloader = new NuGetPackageDownloader(new DirectoryPath(testAsset.Path)); 629var testDir = _testAssetsManager.CreateTestDirectory().Path; 666var testDir = _testAssetsManager.CreateTestDirectory().Path;
CommandTests\Tool\Restore\ToolRestoreCommandTests.cs (2)
320var testDir = _testAssetsManager.CreateTestDirectory().Path; 393var testDir = _testAssetsManager.CreateTestDirectory().Path;
CommandTests\Tool\Run\ToolRunCommandTests.cs (2)
73fileSystem.File.WriteAllText(Path.Combine(testDirectoryRoot.Path, ManifestFilename), 76new ToolManifestFinder(new DirectoryPath(testDirectoryRoot.Path), fileSystem, new FakeDangerousFileDetector());
CommandTests\VSTest\VSTestTests.cs (3)
24var testRoot = testAsset.Path; 99var testRoot = testAsset.Path; 204var testProjectDirectory = testInstance.Path;
CommandTests\Workload\Clean\GivenDotnetWorkloadClean.cs (1)
30var testDirectory = _testAssetsManager.CreateTestDirectory(identifier: userLocal ? $"userlocal-{cleanAll}" : $"default-{cleanAll}").Path;
CommandTests\Workload\Install\GivenDotnetWorkloadInstall.cs (12)
109var testDirectory = _testAssetsManager.CreateTestDirectory().Path; 147var testDirectory = _testAssetsManager.CreateTestDirectory().Path; 180var testDirectory = _testAssetsManager.CreateTestDirectory().Path; 246var cachePath = Path.Combine(_testAssetsManager.CreateTestDirectory(identifier: AppendForUserLocal("mockCache_", userLocal) + sdkVersion).Path, 271var cachePath = Path.Combine(_testAssetsManager.CreateTestDirectory(identifier: AppendForUserLocal("mockCache_", userLocal) + sdkVersion).Path, "mockCachePath"); 330var testDirectory = _testAssetsManager.CreateTestDirectory().Path; 351var testDirectory = _testAssetsManager.CreateTestDirectory(identifier: userLocal ? "userlocal" : "default").Path; 398var testDirectory = _testAssetsManager.CreateTestDirectory().Path; 472var testDirectory = _testAssetsManager.CreateTestDirectory(testName: testName, identifier: (userLocal ? "userlocal" : "default") + sdkVersion).Path; 504var testDirectory = _testAssetsManager.CreateTestDirectory().Path; 530var testDirectory = _testAssetsManager.CreateTestDirectory().Path; 554var testDirectory = _testAssetsManager.CreateTestDirectory().Path;
CommandTests\Workload\Install\GivenFileBasedWorkloadInstall.cs (1)
424var testDirectory = _testAssetsManager.CreateTestDirectory(testName, identifier: identifier).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\Install\WorkloadGarbageCollectionTests.cs (1)
355_testDirectory = _testAssetsManager.CreateTestDirectory(testName, identifier: identifier).Path;
CommandTests\Workload\Install\WorkloadInstallAspireDeprecationTests.cs (3)
25var testDirectory = _testAssetsManager.CreateTestDirectory().Path; 60var testDirectory = _testAssetsManager.CreateTestDirectory().Path; 96var testDirectory = _testAssetsManager.CreateTestDirectory().Path;
CommandTests\Workload\List\GivenDotnetWorkloadList.cs (1)
99var testDirectory = _testAssetsManager.CreateTestDirectory().Path;
CommandTests\Workload\List\GivenWorkloadInstallerAndWorkloadsInstalled.cs (1)
46_testDirectory = _testAssetsManager.CreateTestDirectory(identifier: identifier).Path;
CommandTests\Workload\Repair\GivenDotnetWorkloadRepair.cs (3)
37var testDirectory = _testAssetsManager.CreateTestDirectory(identifier: userLocal ? "userlocal" : "default").Path; 63var testDirectory = _testAssetsManager.CreateTestDirectory(identifier: userLocal ? "userlocal" : "default").Path; 113var testDirectory = _testAssetsManager.CreateTestDirectory(identifier: userLocal ? "userlocal" : "default").Path;
CommandTests\Workload\Restore\DiscoverAllProjectsTests.cs (4)
20.Path; 32.Path; 53.Path; 68.Path;
CommandTests\Workload\Restore\GivenDotnetWorkloadRestore.cs (2)
28.Path; 51.Path;
CommandTests\Workload\Uninstall\GivenDotnetWorkloadUninstall.cs (5)
55var testDirectory = _testAssetsManager.CreateTestDirectory().Path; 67var testDirectory = _testAssetsManager.CreateTestDirectory(identifier: userLocal ? "userlocal" : "default").Path; 88var testDirectory = _testAssetsManager.CreateTestDirectory(identifier: userLocal ? "userlocal" : "default").Path; 102var testDirectory = _testAssetsManager.CreateTestDirectory(identifier: userLocal ? "userlocal" : "default").Path; 146var testDirectory = _testAssetsManager.CreateTestDirectory(identifier: userLocal ? "userlocal" : "default").Path;
CommandTests\Workload\Update\GivenDotnetWorkloadUpdate.cs (9)
115var testDirectory = _testAssetsManager.CreateTestDirectory(identifier: userLocal ? "userlocal" : "default").Path; 201var testDirectory = _testAssetsManager.CreateTestDirectory(identifier: userLocal ? "userlocal" : "default").Path; 296string dotnetDir = Path.Combine(testDir.Path, "dotnet"); 297string userProfileDir = Path.Combine(testDir.Path, "userProfileDir"); 374var testDirectory = _testAssetsManager.CreateTestDirectory(testName: "GivenWorkloadUpdateItFindsGreatestWorkloadSetWithSpecifiedComponents").Path; 421var cachePath = Path.Combine(_testAssetsManager.CreateTestDirectory(identifier: "cachePath").Path, "mockCachePath"); 486var testDirectory = _testAssetsManager.CreateTestDirectory().Path; 587var testDirectory = _testAssetsManager.CreateTestDirectory().Path; 625var testDirectory = _testAssetsManager.CreateTestDirectory(testName: testName, identifier).Path;
GivenThatDotNetRunsCommands.cs (2)
29.WithWorkingDirectory(testInstance.Path) 54var home = _testAssetsManager.CreateTestDirectory(identifier: "DOTNET_HOME").Path;
GivenThatICareAboutVBApps.cs (1)
31.WithWorkingDirectory(testInstance.Path)
GivenThatTheUserEnablesThePerfLog.cs (4)
20.WithEnvironmentVariable("DOTNET_PERFLOG_DIR", dir.Path) 24Assert.Empty(new DirectoryInfo(dir.Path).GetFiles()); 34.WithEnvironmentVariable("DOTNET_PERFLOG_DIR", dir.Path) 39DirectoryInfo logDir = new(dir.Path);
GivenThatTheUserIsRunningDotNetForTheFirstTime.cs (1)
22TestDirectory = testAssets.CreateTestDirectory(testName).Path;
GivenThatWeWantToBeBackwardsCompatibleWith1xProjects.cs (5)
22ChangeProjectTargetFramework(Path.Combine(testInstance.Path, $"{testAppName}.csproj"), target); 51ChangeProjectTargetFramework(Path.Combine(testInstance.Path, $"{testAppName}.csproj"), target); 57new PackCommand(Log, testInstance.Path) 69NuGetConfigWriter.Write(testInstance.Path, TestContext.Current.TestPackages); 77.WithWorkingDirectory(testInstance.Path)
PackagedCommandTests.cs (16)
28NuGetConfigWriter.Write(testInstance.Path, TestContext.Current.TestPackages); 35.WithWorkingDirectory(testInstance.Path) 50NuGetConfigWriter.Write(testInstance.Path, TestContext.Current.TestPackages); 69.WithWorkingDirectory(testInstance.Path) 85NuGetConfigWriter.Write(testInstance.Path, TestContext.Current.TestPackages); 127.WithWorkingDirectory(testInstance.Path) 141NuGetConfigWriter.Write(testInstance.Path, TestContext.Current.TestPackages); 148.WithWorkingDirectory(testInstance.Path) 162.WithWorkingDirectory(testInstance.Path) 178var appWithDepOnToolDir = new DirectoryInfo(testInstance.Path).Sub("AppWithDepOnTool"); 179var toolWithRandPkgNameDir = new DirectoryInfo(testInstance.Path).Sub("ToolWithRandomPackageName"); 180var pkgsDir = new DirectoryInfo(testInstance.Path).CreateSubdirectory("pkgs"); 220NuGetConfigWriter.Write(testInstance.Path, TestContext.Current.TestPackages); 225.WithWorkingDirectory(testInstance.Path) 236NuGetConfigWriter.Write(testInstance.Path, TestContext.Current.TestPackages); 245.WithWorkingDirectory(testInstance.Path)
ParserTests\ResponseFileTests.cs (2)
18var tempFileDir = _testAssetsManager.CreateTestDirectory().Path; 48var tempFileDir = _testAssetsManager.CreateTestDirectory().Path;
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
RuntimeConfigTests.cs (1)
126return Path.Combine(_testAssetsManager.CreateTestDirectory(callingMethod).Path, Path.GetTempFileName());
ShellShimTests\ShellShimRepositoryTests.cs (4)
100var testFolder = _testAssetsManager.CreateTestDirectory().Path; 425var tempDir = _testAssetsManager.CreateTestDirectory(identifier: tfm).Path; 510var outputDirectory = new DirectoryInfo(OutputPathCalculator.FromProject(testInstance.Path, testInstance).GetOutputDirectory(configuration: configuration)); 517return _testAssetsManager.CreateTestDirectory(testName: callingMethod, identifier: "cleanfolder" + identifier + Path.GetRandomFileName()).Path;
TelemetryTests\SenderTests.cs (1)
171string tempPath = Path.Combine(_testAssetsManager.CreateTestDirectory("TestStorageService", identifier: testName).Path, Path.GetTempFileName());
TelemetryTests\StorageTests.cs (1)
199return _testAssetsManager.CreateTestDirectory(callingMethod).Path;
dotnet-format.UnitTests (13)
MSBuild\MSBuildWorkspaceFinderTests.cs (12)
26testInstance.Path).Replace('/', Path.DirectorySeparatorChar); 27var exception = Assert.Throws<FileNotFoundException>(() => MSBuildWorkspaceFinder.FindWorkspace(testInstance.Path)); 39testInstance.Path).Replace('/', Path.DirectorySeparatorChar); 40var exception = Assert.Throws<FileNotFoundException>(() => MSBuildWorkspaceFinder.FindWorkspace(testInstance.Path)); 52testInstance.Path).Replace('/', Path.DirectorySeparatorChar); 53var exception = Assert.Throws<FileNotFoundException>(() => MSBuildWorkspaceFinder.FindWorkspace(testInstance.Path)); 65testInstance.Path).Replace('/', Path.DirectorySeparatorChar); 66var exception = Assert.Throws<FileNotFoundException>(() => MSBuildWorkspaceFinder.FindWorkspace(testInstance.Path)); 77var (isSolution, workspacePath) = MSBuildWorkspaceFinder.FindWorkspace(testInstance.Path); 91var (isSolution, workspacePath) = MSBuildWorkspaceFinder.FindWorkspace(testInstance.Path, "solution_b.sln"); 129var (isSolution, workspacePath) = MSBuildWorkspaceFinder.FindWorkspace(testInstance.Path); 143var (isSolution, workspacePath) = MSBuildWorkspaceFinder.FindWorkspace(testInstance.Path, "project_b.csproj");
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
dotnet-MsiInstallation.Tests (1)
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
dotnet-new.IntegrationTests (40)
BaseIntegrationTest.cs (1)
145string testPath = testAsset.Path;
PostActionTests.Approval.cs (9)
13string templateLocation = _testAssetsManager.CopyTestAsset("PostActions/RestoreNuGet/Basic", testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path; 44string templateLocation = _testAssetsManager.CopyTestAsset("PostActions/RunScript/Basic", testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path; 67string templateLocation = _testAssetsManager.CopyTestAsset("PostActions/AddPackageReference/Basic", testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path; 98string templateLocation = _testAssetsManager.CopyTestAsset("PostActions/AddProjectReference/Basic", testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path; 129string templateLocation = _testAssetsManager.CopyTestAsset("PostActions/AddProjectToSolution/Basic", testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path; 169string templateLocation = _testAssetsManager.CopyTestAsset("PostActions/Instructions/Basic", testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path; 191string templateLocation = _testAssetsManager.CopyTestAsset("PostActions/RestoreNuGet/Basic", testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path; 215string templateLocation = _testAssetsManager.CopyTestAsset("PostActions/UnknownPostAction", testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path; 235string templateLocation = _testAssetsManager.CopyTestAsset("PostActions/RunScript/Basic", testAssetSubdirectory: DotnetNewTestTemplatesBasePath).WithSource().Path;
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;
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
dotnet-watch.Tests (103)
Build\EvaluationTests.cs (3)
426.Path; 516var testDir = testAsset.Path; 577=> Path.Combine(projectAsset.Path, projectAsset.TestProject!.Name!, projectAsset.TestProject!.Name + ".csproj");
Build\FileSetSerializerTests.cs (1)
107var dir = _testAssetManager.CreateTestDirectory().Path;
CommandLine\LaunchSettingsTests.cs (2)
97var source = Path.Combine(testAsset.Path, "Program.cs"); 130var directoryInfo = new DirectoryInfo(testAsset.Path);
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,
FileWatcher\FileWatcherTests.cs (10)
152var dir = _testAssetManager.CreateTestDirectory(identifier: usePolling.ToString()).Path; 184var dir = _testAssetManager.CreateTestDirectory(identifier: usePolling.ToString()).Path; 221var dir = _testAssetManager.CreateTestDirectory(identifier: usePolling.ToString()).Path; 238var dir = _testAssetManager.CreateTestDirectory(identifier: usePolling.ToString()).Path; 268var dir = _testAssetManager.CreateTestDirectory(identifier: $"{usePolling}{watchSubdirectories}").Path; 320var dir = _testAssetManager.CreateTestDirectory(identifier: usePolling.ToString()).Path; 348var dir = _testAssetManager.CreateTestDirectory(identifier: usePolling.ToString()).Path; 374var dir = _testAssetManager.CreateTestDirectory(identifier: usePolling.ToString()).Path; 403var dir = _testAssetManager.CreateTestDirectory(identifier: usePolling.ToString()).Path; 462var dir = _testAssetManager.CreateTestDirectory(usePolling.ToString()).Path;
HotReload\ApplyDeltaTests.cs (44)
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"); 449var programPath = Path.Combine(testAsset.Path, "Program.cs"); 504var programPath = Path.Combine(testAsset.Path, "Program.cs"); 538var programPath = Path.Combine(testAsset.Path, "Program.cs"); 565UpdateSourceFile(Path.Combine(testAsset.Path, "Program.fs"), content => content.Replace("Hello World!", "<Updated>")); 590var sourcePath = Path.Combine(testAsset.Path, "Program.fs"); 635UpdateSourceFile(Path.Combine(testAsset.Path, "App", "Update.cs"), newSrc); 646var sourcePath = Path.Combine(testAsset.Path, "Program.cs"); 679var sourcePath = Path.Combine(testAsset.Path, "Program.cs"); 727var programPath = Path.Combine(testAsset.Path, "Program.cs"); 798UpdateSourceFile(Path.Combine(testAsset.Path, "Pages", "Index.razor"), newSource); 897var scopedCssPath = Path.Combine(testAsset.Path, "RazorClassLibrary", "Components", "Example.razor.css"); 913var cssPath = Path.Combine(testAsset.Path, "RazorApp", "wwwroot", "app.css"); 937WorkingDirectory = testAsset.Path, 950var razorPath = Path.Combine(testAsset.Path, "Components", "Pages", "Home.razor"); 961var cssPath = Path.Combine(testAsset.Path, "wwwroot", "css", "app.css"); 997foreach (var depDll in Directory.GetFiles(testAsset.Path, "Dep2.dll", SearchOption.AllDirectories)) 1002File.WriteAllText(Path.Combine(testAsset.Path, "App", "Update.cs"), newSrc); 1017var dependencyDir = Path.Combine(testAsset.Path, "Dependency"); 1069var dependencyDir = Path.Combine(testAsset.Path, "Dependency"); 1124var serviceSourcePath = Path.Combine(testAsset.Path, "WatchAspire.ApiService", "Program.cs"); 1125var serviceProjectPath = Path.Combine(testAsset.Path, "WatchAspire.ApiService", "WatchAspire.ApiService.csproj"); 1128var webSourcePath = Path.Combine(testAsset.Path, "WatchAspire.Web", "Program.cs"); 1129var webProjectPath = Path.Combine(testAsset.Path, "WatchAspire.Web", "WatchAspire.Web.csproj"); 1220var webSourcePath = Path.Combine(testAsset.Path, "WatchAspire.Web", "Program.cs"); 1221var webProjectPath = Path.Combine(testAsset.Path, "WatchAspire.Web", "WatchAspire.Web.csproj");
HotReload\CompilationHandlerTests.cs (2)
14var workingDirectory = testAsset.Path; 15var hostDir = Path.Combine(testAsset.Path, "Host");
HotReload\RuntimeProcessLauncherTests.cs (25)
99var environmentOptions = TestOptions.GetEnvironmentOptions(workingDirectory ?? testAsset.Path, TestContext.Current.ToolsetUnderTest.DotNetHostPath, testAsset); 152var workingDirectory = testAsset.Path; 153var hostDir = Path.Combine(testAsset.Path, "Host"); 155var serviceDirA = Path.Combine(testAsset.Path, "ServiceA"); 159var serviceDirB = Path.Combine(testAsset.Path, "ServiceB"); 161var libDir = Path.Combine(testAsset.Path, "Lib"); 317var workingDirectory = testAsset.Path; 318var hostDir = Path.Combine(testAsset.Path, "Host"); 320var serviceDirA = Path.Combine(testAsset.Path, "ServiceA"); 322var serviceDirB = Path.Combine(testAsset.Path, "ServiceB"); 324var libDir = Path.Combine(testAsset.Path, "Lib"); 411var workingDirectory = testAsset.Path; 412var hostDir = Path.Combine(testAsset.Path, "Host"); 415var libProject = Path.Combine(testAsset.Path, "Lib2", "Lib2.csproj"); 416var lib = Path.Combine(testAsset.Path, "Lib2", "Lib2.cs"); 500var workingDirectory = testAsset.Path; 501var hostDir = Path.Combine(testAsset.Path, "Host"); 503var serviceDirA = Path.Combine(testAsset.Path, "ServiceA"); 556var workingDirectory = testAsset.Path; 653var workingDirectory = testAsset.Path; 654var projectPath = Path.Combine(testAsset.Path, "WatchHotReloadApp.csproj"); 655var programPath = Path.Combine(testAsset.Path, "Program.cs"); 707var appProjDir = Path.Combine(testAsset.Path, "AppWithDeps"); 769var projFilePath = Path.Combine(testAsset.Path, "WatchHotReloadApp.csproj"); 770var programFilePath = Path.Combine(testAsset.Path, "Program.cs");
Process\LaunchSettingsProfileTest.cs (2)
84var projectPath = Path.Combine(project.Path, "Project1", "Project1.csproj"); 100=> Path.Combine(testAsset.Path, testAsset.TestProject.Name);
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
TestUtilities\TestOptions.cs (1)
32: asset.Path + ".hotreload";
TestUtilities\WatchableApp.cs (2)
154var projectDirectory = (relativeProjectDirectory != null) ? Path.Combine(asset.Path, relativeProjectDirectory) : asset.Path;
Watch\GlobbingAppTests.cs (3)
19operation(testAsset.Path); 82var changedFile = Path.Combine(testAsset.Path, "exclude", "Baz.cs"); 103testAsset.Path,
Watch\NoDepsAppTests.cs (2)
19UpdateSourceFile(Path.Combine(testAsset.Path, "Program.cs")); 44UpdateSourceFile(Path.Combine(testAsset.Path, "Program.cs"));
EndToEnd.Tests (28)
GivenDotNetUsesMSBuild.cs (7)
15string projectDirectory = _testAssetsManager.CreateTestDirectory().Path; 62NuGetConfigWriter.Write(testInstance.Path, TestContext.Current.TestPackages); 68var testProjectDirectory = testInstance.Path; 71.WithWorkingDirectory(testInstance.Path) 96NuGetConfigWriter.Write(testInstance.Path, TestContext.Current.TestPackages); 102var testProjectDirectory = testInstance.Path; 105.WithWorkingDirectory(testInstance.Path)
GivenNetFrameworkSupportsNetStandard2.cs (1)
15string projectDirectory = Path.Combine(_testInstance.Path, "TestApp");
GivenSelfContainedAppsRollForward.cs (2)
17string projectDirectory = directory.Path; 42string projectDirectory = directory.Path;
GivenWindowsApp.cs (2)
28var projectPath = Path.Combine(testInstance.Path, "consolecswinrt.csproj"); 57.WithWorkingDirectory(testInstance.Path)
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
ProjectBuildTests.cs (15)
16string projectDirectory = directory.Path; 23string projectPath = Path.Combine(projectDirectory, new DirectoryInfo(directory.Path).Name + ".csproj"); 58string projectDirectory = directory.Path; 65string projectPath = Path.Combine(projectDirectory, new DirectoryInfo(directory.Path).Name + ".csproj"); 90string projectDirectory = directory.Path; 120selfContainedPublishDir.Should().HaveFilesMatching($"{new DirectoryInfo(directory.Path).Name}.dll", SearchOption.TopDirectoryOnly); 129string projectDirectory = directory.Path; 159selfContainedPublishDir.Should().HaveFilesMatching($"{new DirectoryInfo(directory.Path).Name}.dll", SearchOption.TopDirectoryOnly); 226string projectDirectory = directory.Path; 236var directoryInfo = new DirectoryInfo(directory.Path); 269string projectDirectory = directory.Path; 284var directoryInfo = new DirectoryInfo(directory.Path); 419string projectDirectory = directory.Path; 481new DirectoryInfo(directory.Path).Delete(true); 497string projectDirectory = directory.Path;
Microsoft.AspNetCore.Watch.BrowserRefresh.Tests (1)
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
Microsoft.CodeAnalysis.NetAnalyzers.UnitTests (1)
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
Microsoft.DotNet.ApiDiff.Tests (1)
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
Microsoft.DotNet.Cli.Utils.Tests (6)
DangerousFileDetectorTests.cs (3)
26var testFile = Path.Combine(_testAssetsManager.CreateTestDirectory().Path, Path.GetRandomFileName()); 48var testFile = Path.Combine(_testAssetsManager.CreateTestDirectory().Path, Path.GetRandomFileName()); 56var testFile = Path.Combine(_testAssetsManager.CreateTestDirectory().Path, Path.GetRandomFileName());
GivenAppThrowingException.cs (2)
17.Path; 37.Path;
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
Microsoft.DotNet.GenAPI.Tests (1)
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
Microsoft.DotNet.MSBuildSdkResolver.Tests (1)
GivenAnMSBuildSdkResolver.cs (1)
645testName: callingMethod).Path);
Microsoft.DotNet.PackageInstall.Tests (26)
EndToEndToolTests.cs (18)
28var homeFolder = Path.Combine(testDirectory.Path, "home"); 32.WithWorkingDirectory(testDirectory.Path) 42.WithWorkingDirectory(testDirectory.Path) 61var homeFolder = Path.Combine(testDirectory.Path, "home"); 65.WithWorkingDirectory(testDirectory.Path) 75.WithWorkingDirectory(testDirectory.Path) 88var homeFolder = Path.Combine(testDirectory.Path, "home"); 92.WithWorkingDirectory(testDirectory.Path) 98.WithWorkingDirectory(testDirectory.Path) 104.WithWorkingDirectory(testDirectory.Path) 122var homeFolder = Path.Combine(testDirectory.Path, "home"); 126.WithWorkingDirectory(testDirectory.Path) 132.WithWorkingDirectory(testDirectory.Path) 138.WithWorkingDirectory(testDirectory.Path) 283var homeFolder = Path.Combine(testDirectory.Path, "home"); 287.WithWorkingDirectory(testDirectory.Path) 311var homeFolder = Path.Combine(testDirectory.Path, "home"); 315.WithWorkingDirectory(testDirectory.Path)
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
TestToolBuilder.cs (1)
154var testAssetProjectDirectory = Path.Combine(testAsset.Path, testProject.Name!);
ToolPackageDownloaderTests.cs (3)
727var store = new ToolPackageStoreAndQuery(new DirectoryPath(root.Path)); 729var nugetConfigPath = new FilePath(Path.Combine(root.Path, "NuGet.config")); 877var root = new DirectoryPath(_testAssetsManager.CreateTestDirectory(callingMethod, identifier: useMock.ToString() + identiifer).Path);
ToolPackageInstallerNugetCacheTests.cs (2)
28string testDirectory = _testAssetsManager.CreateTestDirectory(identifier: testMockBehaviorIsInSync.ToString()).Path; 72string testDirectory = _testAssetsManager.CreateTestDirectory(identifier: testMockBehaviorIsInSync.ToString()).Path;
ToolPackageUninstallerTests.cs (1)
75var root = new DirectoryPath(_testAssetsManager.CreateTestDirectory(testName, identifier).Path);
Microsoft.DotNet.TemplateLocator.Tests (1)
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
Microsoft.Extensions.DotNetDeltaApplier.Tests (1)
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
Microsoft.NET.Build.Containers.UnitTests (1)
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
Microsoft.NET.Build.Extensions.Tasks.UnitTests (1)
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
Microsoft.NET.Build.Tasks.UnitTests (7)
GivenAResolveRuntimePackAssetsTask.cs (1)
23var testDirectory = _testAssetsManager.CreateTestDirectory().Path;
GivenAResolveTargetingPackAssetsTask.cs (1)
132mockPackageDirectory = _testAssetsManager.CreateTestDirectory(testName: testName).Path;
GivenThatWeWantToGetDependenciesViaDesignTimeBuild.cs (4)
22var testRoot = _testAssetsManager.CreateTestDirectory().Path; 55var testRoot = _testAssetsManager.CreateTestDirectory().Path; 90var testRoot = _testAssetsManager.CreateTestDirectory().Path; 359var testRoot = _testAssetsManager.CreateTestDirectory().Path;
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
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"));
EvaluatorFastPathTests.cs (3)
22.WithWorkingDirectory(testAsset.Path); 28var logPath = Path.Combine(testAsset.Path, "PropertyFunctionsRequiringReflection"); 37var testDir = _testAssetsManager.CreateTestDirectory().Path;
GivenFrameworkReferences.cs (1)
1160var command = new GetValuesCommand(Log, Path.Combine(testAsset.Path, testProject.Name), targetFramework,
GivenThatWeHaveAPackageReferenceWithAliases.cs (3)
49.WithWorkingDirectory(testAsset.Path); 94.WithWorkingDirectory(testAsset.Path); 131.WithWorkingDirectory(testAsset.Path);
GivenThatWeWantToBuildADesktopLibrary.cs (1)
427string projectFolder = Path.Combine(testAsset.Path, project.Name);
GivenThatWeWantToBuildALibrary.cs (5)
542var buildCommand = new BuildCommand(Log, Path.Combine(testAsset.Path, testProj.Name)); 687var relativePathToSln = Path.GetFileName(testAsset.Path) + ".sln"; 837Path.Combine(asset.Path, project.Name), 1033File.WriteAllText(Path.Combine(testAsset.Path, testProject.Name, $"{testProject.Name}.cs"), @" 1045string projectFolder = Path.Combine(testAsset.Path, testProject.Name);
GivenThatWeWantToBuildALibraryWithOSSupportedVersion.cs (1)
152var buildCommand = new DotnetBuildCommand(Log, Path.Combine(testAsset.Path, "Project", "Project.csproj"));
GivenThatWeWantToBuildANetCoreApp.cs (1)
1123var buildCommand = new BuildCommand(Log, Path.Combine(testAsset.Path, testProj.Name));
GivenThatWeWantToBuildASelfContainedApp.cs (3)
398.WithWorkingDirectory(Path.Combine(testAsset.Path, "MainProject")) 431.WithWorkingDirectory(testAsset.Path) 495Path.Combine(asset.Path, project.Name),
GivenThatWeWantToBuildAWindowsDesktopProject.cs (6)
148var testDirectory = _testAssetsManager.CreateTestDirectory().Path; 257.WithWorkingDirectory(testDir.Path) 262var projectPath = Path.Combine(testDir.Path, Path.GetFileName(testDir.Path) + ".csproj"); 281File.WriteAllText(Path.Combine(testDir.Path, "Directory.Build.targets"), DirectoryBuildTargetsContent); 283var buildCommand = new BuildCommand(Log, testDir.Path);
GivenThatWeWantToBuildAWindowsRuntimeComponent.cs (1)
262PackagesDirectory = Path.Combine(testAsset.Path, "packages")
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));
GivenThatWeWantToBuildWithGlobalJson.cs (1)
27var globalJsonPath = Path.Combine(testAsset.Path, testProject.Name, "global.json");
GivenThatWeWantToControlGeneratedAssemblyInfo.cs (1)
855buildCommand.WithWorkingDirectory(testAsset.Path)
GivenThatWeWantToProduceReferenceAssembly.cs (1)
29var filePath = Path.Combine(testAsset.Path, testProject.Name, "obj", "Debug", targetFramework, "ref", $"{testProject.Name}.dll");
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");
GivenThatWeWantToSetPropertiesInDirectoryBuildProps.cs (2)
23string directoryBuildPropsPath = Path.Combine(testAsset.Path, "Directory.Build.props"); 42string projectFolder = Path.Combine(testAsset.Path, project.Name);
GivenThatWeWantToUseAnalyzers.cs (8)
112asset.Path, 118.WithWorkingDirectory(asset.Path) 140asset.Path, 146.WithWorkingDirectory(asset.Path) 207Path.Combine(asset.Path, "NonWebAppWithAspNet"), 213.WithWorkingDirectory(asset.Path) 249Path.Combine(asset.Path, "TestApp"), 255.WithWorkingDirectory(asset.Path)
GivenThatWeWantToUseVB.cs (1)
178var testDirectory = _testAssetsManager.CreateTestDirectory().Path;
GivenTransitiveFrameworkReferencesAreDisabled.cs (3)
32string nugetPackagesFolder = _testAssetsManager.CreateTestDirectory(testName, identifier: "packages_" + referenceAspNet).Path; 110string nugetPackagesFolder = _testAssetsManager.CreateTestDirectory(identifier: "packages").Path; 155string nugetPackagesFolder = _testAssetsManager.CreateTestDirectory(identifier: "packages").Path;
GiventThatWeWantDesignerSupport.cs (1)
69Path.Combine(asset.Path, project.Name),
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),
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
ProjectConfigurationDescriptionTest.cs (2)
26File.WriteAllText(Path.Combine(testAsset.Path, testProj.Name, $"{testProj.Name}.cs"), @" 41var buildCommand = new BuildCommand(Log, Path.Combine(testAsset.Path, testProj.Name));
ReferenceExeTests.cs (4)
402var mtpProjectDirectory = Path.Combine(testAssetMTP.Path, "MTPTestProject"); 462var consoleAppDirectory = Path.Combine(testAssetSelfContained.Path, testConsoleProjectSelfContained.Name); 500string consoleProjectDirectory = Path.Combine(testAsset.Path, testConsoleProject.Name); 535var mtpProjectDirectory = Path.Combine(testAssetMTP.Path, mtpSelfContained.Name);
RoslynBuildTaskTests.cs (1)
135buildCommand.WithWorkingDirectory(testAsset.Path)
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)
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
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");
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
SolutionPackTests.cs (2)
29string packageOutputPath = Path.Combine(testAsset.Path, "output", "packages"); 32.WithWorkingDirectory(testAsset.Path)
Microsoft.NET.Publish.Tests (84)
FilesCopiedToPublishDirTests.cs (1)
56Path.Combine(testAsset.Path, testProject.Name),
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);
GivenThatWeWantToPublishAProjectWithDependencies.cs (2)
119string filterProjDir = _testAssetsManager.CopyTestAsset("StoreManifests").WithSource().Path; 168string filterProjDir = _testAssetsManager.CopyTestAsset("StoreManifests").WithSource().Path;
GivenThatWeWantToPublishAToolProject.cs (1)
59publishCommand.WithWorkingDirectory(testAsset.Path).Execute($"-bl:{binlogDestPath}");
GivenThatWeWantToPublishAWebApp.cs (1)
185var projectDirectory = Path.Combine(testProjectInstance.Path, testProject.Name);
GivenThatWeWantToPublishIncrementally.cs (5)
115var publishCommand = new PublishCommand(testAsset).WithWorkingDirectory(testAsset.Path) as PublishCommand; 186.WithWorkingDirectory(testDir.Path) 197new PublishCommand(Log, Path.Combine(testDir.Path, assetName)) 201var publishDir = Path.Combine(Directory.GetDirectories(Path.Combine(testDir.Path, assetName, "bin", "Debug")).FirstOrDefault(), runtimeId, "publish"); 208new PublishCommand(Log, Path.Combine(testDir.Path, assetName))
GivenThatWeWantToPublishReadyToRun.cs (1)
258var publishCommand = new PublishCommand(Log, Path.Combine(testProjectInstance.Path, testProject.Name));
GivenThatWeWantToPublishToClickOnce.cs (1)
35var 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")
GivenThatWeWantToStoreAProjectWithDependencies.cs (1)
136WorkingDirectory = simpleDependenciesAsset.Path
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));
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
PublishDepsFilePathTests.cs (2)
20var projectPath = Path.Combine(testAsset.Path, testProject.Name); 42var projectPath = Path.Combine(testAsset.Path, testProject.Name);
PublishItemsOutputGroupOutputsTests.cs (2)
56Path.Combine(testAsset.Path, testProject.Name), 70OutputPath = Path.GetFileName(Path.GetFullPath(Path.Combine(testAsset.Path, testProject.Name, item.metadata["OutputPath"])))
PublishItemsOutputGroupTests.cs (1)
40Path.Combine(testAsset.Path, testProject.Name),
PublishWpfApp.cs (9)
21.WithWorkingDirectory(testDir.Path) 26var project = XDocument.Load(Path.Combine(testDir.Path, Path.GetFileName(testDir.Path) + ".csproj")); 34string mainWindowXamlCsPath = Path.Combine(testDir.Path, "MainWindow.xaml.cs"); 42var restoreCommand = new RestoreCommand(Log, testDir.Path); 47var publishCommand = new PublishCommand(Log, testDir.Path); 53var publishDirectory = OutputPathCalculator.FromProject(Path.Combine(testDir.Path, Path.GetFileName(testDir.Path) + ".csproj")).GetPublishDirectory( 59FileName = Path.Combine(publishDirectory, Path.GetFileName(testDir.Path) + ".exe")
Microsoft.NET.Rebuild.Tests (1)
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
Microsoft.NET.Restore.Tests (18)
GivenThatWeWantAutomaticTargetingPackReferences.cs (4)
37testAsset.Path, 90testAsset.Path, 157testAsset.Path, 199testAsset.Path,
GivenThatWeWantRestoreToUseImplicitPackages.cs (2)
32testAsset.Path, 66testAsset.Path,
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")));
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
RestoreWithOlderNuGet.cs (1)
24var restoreCommand = new NuGetExeRestoreCommand(Log, testAsset.Path, testProject.Name)
Microsoft.Net.Sdk.AnalyzerRedirecting.Tests (6)
SdkAnalyzerAssemblyRedirectorTests.cs (6)
18var vsDir = Path.Combine(testDir.Path, "vs"); 20var sdkAnalyzerPath = FakeDll(testDir.Path, @$"sdk\packs\Microsoft.AspNetCore.App.Ref\{b}\analyzers\dotnet\cs", "Microsoft.AspNetCore.App.Analyzers"); 32var vsDir = Path.Combine(testDir.Path, "vs"); 34var sdkAnalyzerPath = FakeDll(testDir.Path, @"sdk\packs\Microsoft.AspNetCore.App.Ref\9.0.0-preview.7.24406.2\analyzers\dotnet\vb", "Microsoft.AspNetCore.App.Analyzers"); 52var vsDir = Path.Combine(testDir.Path, "vs"); 54var sdkAnalyzerPath = FakeDll(testDir.Path, @$"sdk\packs\Microsoft.AspNetCore.App.Ref\{b}\analyzers\dotnet\cs", "Microsoft.AspNetCore.App.Analyzers");
Microsoft.NET.Sdk.BlazorWebAssembly.AoT.Tests (1)
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
Microsoft.NET.Sdk.BlazorWebAssembly.Tests (12)
AspNetSdkBaselineTest.cs (2)
289ProjectDirectory.Path, 297var template = Templatize(actual, ProjectDirectory.Path, GetNuGetCachePath() ?? TestContext.Current.NuGetCachePath, runtimeIdentifier);
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");
BlazorLegacyIntegrationTest60.cs (2)
32var clientBuildOutputDirectory = Path.Combine(testInstance.Path, "Client", "bin", "Debug", targetFramework); 41var serverBuildOutputDirectory = Path.Combine(testInstance.Path, "Server", "bin", "Debug", targetFramework);
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
VanillaWasmTests.cs (1)
29var buildOutputDirectory = Path.Combine(testInstance.Path, "bin", "Debug", targetFramework);
WasmBuildIntegrationTest.cs (2)
684File.WriteAllText(Path.Combine(testInstance.Path, "razorclasslibrary", "TestReference.cs"), 764File.WriteAllText(Path.Combine(testInstance.Path, "blazorwasm", "TestReference.cs"),
WasmPublishIntegrationTest.cs (1)
1599File.WriteAllText(Path.Combine(testInstance.Path, "razorclasslibrary", "TestReference.cs"),
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);
BuildIntegrationTest.cs (3)
33.And.NotHaveStdOutContaining($"SimpleMvc -> {Path.Combine(projectDirectory.Path, outputPath, "SimpleMvc.Views.dll")}"); 64var filePath = Path.Combine(projectDirectory.Path, "Views", "Home", "Index.cshtml"); 215var class2Path = Path.Combine(projectDirectory.Path, "AnotherClassLib", "Class2.cs");
BuildIntrospectionTest.cs (2)
102var build = new MSBuildCommand(Log, "_IntrospectWatchItems", projectDirectory.Path); 118var build = new MSBuildCommand(Log, "_IntrospectRazorGenerateComponentDesignTime", projectDirectory.Path);
BuildWithComponentsIntegrationTest.cs (1)
68var projectFile = Path.Combine(projectDirectory.Path, "ComponentApp.csproj");
DesignTimeBuildIntegrationTest.cs (3)
20var command = new MSBuildCommand(Log, "Compile", projectDirectory.Path); 42var command = new MSBuildCommand(Log, "RazorGenerateDesignTime;_IntrospectRazorGenerateWithTargetPath", projectDirectory.Path); 73var command = new MSBuildCommand(Log, "RazorGenerateComponentDesignTime;_IntrospectRazorComponentWithTargetPath", projectDirectory.Path);
MvcBuildIntegrationTest50.cs (2)
22var indexPage = Path.Combine(projectDirectory.Path, "Views", "Shared", "NavMenu.razor"); 95var scopedCssPath = Path.Combine(project.Path, "wwwroot", "Views", "Home", "Index.cshtml.css");
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"),
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
PublishIntegrationTest.cs (2)
54var outputPath = Path.Combine(projectDirectory.Path, "bin", "Debug", DefaultTfm); 71Directory.Delete(Path.Combine(projectDirectory.Path, "Views"), recursive: true);
Microsoft.NET.Sdk.Razor.Tool.Tests (35)
DefaultExtensionAssemblyLoaderTest.cs (15)
17var alphaFilePath = LoaderTestResources.Alpha.WriteToFile(directory.Path, "Alpha.dll"); 19var loader = new TestDefaultExtensionAssemblyLoader(Path.Combine(directory.Path, "shadow")); 33var alphaFilePath = LoaderTestResources.Alpha.WriteToFile(directory.Path, "Alpha.dll"); 34var alphaFilePath2 = LoaderTestResources.Alpha.WriteToFile(directory.Path, "Alpha2.dll"); 36var loader = new TestDefaultExtensionAssemblyLoader(Path.Combine(directory.Path, "shadow")); 53var alphaFilePath = LoaderTestResources.Alpha.WriteToFile(directory.Path, "Alpha.dll"); 54var alphaFilePath2 = LoaderTestResources.Alpha.WriteToFile(directory.Path, "Alpha2.dll"); 56var loader = new TestDefaultExtensionAssemblyLoader(Path.Combine(directory.Path, "shadow")); 72var alphaFilePath = LoaderTestResources.Alpha.WriteToFile(directory.Path, "Alpha.dll"); 74var loader = new TestDefaultExtensionAssemblyLoader(Path.Combine(directory.Path, "shadow")); 89var alphaFilePath = LoaderTestResources.Alpha.WriteToFile(directory.Path, "Alpha.dll"); 90var betaFilePath = LoaderTestResources.Beta.WriteToFile(directory.Path, "Beta.dll"); 91var gammaFilePath = LoaderTestResources.Gamma.WriteToFile(directory.Path, "Gamma.dll"); 92var deltaFilePath = LoaderTestResources.Delta.WriteToFile(directory.Path, "Delta.dll"); 94var loader = new TestDefaultExtensionAssemblyLoader(Path.Combine(directory.Path, "shadow"));
DefaultExtensionDependencyCheckerTest.cs (14)
19var alphaFilePath = LoaderTestResources.Alpha.WriteToFile(directory.Path, "Alpha.dll"); 21var loader = new TestDefaultExtensionAssemblyLoader(Path.Combine(directory.Path, "shadow")); 38var alphaFilePath = LoaderTestResources.Alpha.WriteToFile(directory.Path, "Alpha.dll"); 39var betaFilePath = LoaderTestResources.Beta.WriteToFile(directory.Path, "Beta.dll"); 40var gammaFilePath = LoaderTestResources.Gamma.WriteToFile(directory.Path, "Gamma.dll"); 41var deltaFilePath = LoaderTestResources.Delta.WriteToFile(directory.Path, "Delta.dll"); 43var loader = new TestDefaultExtensionAssemblyLoader(Path.Combine(directory.Path, "shadow")); 62var alphaFilePath = LoaderTestResources.Beta.WriteToFile(directory.Path, "Alpha.dll"); 63var betaFilePath = LoaderTestResources.Beta.WriteToFile(directory.Path, "Beta.dll"); 64var gammaFilePath = LoaderTestResources.Gamma.WriteToFile(directory.Path, "Gamma.dll"); 65var deltaFilePath = LoaderTestResources.Delta.WriteToFile(directory.Path, "Delta.dll"); 67var loader = new TestDefaultExtensionAssemblyLoader(Path.Combine(directory.Path, "shadow")); 72LoaderTestResources.Alpha.WriteToFile(directory.Path, "Alpha.dll"); 88var deltaFilePath = LoaderTestResources.Delta.WriteToFile(directory.Path, "Delta.dll");
MetadataCacheTest.cs (5)
16var assemblyFilePath = LoaderTestResources.Delta.WriteToFile(directory.Path, "Delta.dll"); 32var assemblyFilePath = LoaderTestResources.Delta.WriteToFile(directory.Path, "Delta.dll"); 55var assemblyFilePath1 = LoaderTestResources.Delta.WriteToFile(directory.Path, "Delta.dll"); 56var assemblyFilePath2 = LoaderTestResources.Gamma.WriteToFile(directory.Path, "Gamma.dll"); 73var assemblyFilePath = LoaderTestResources.Delta.WriteToFile(directory.Path, "Delta.dll");
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
Microsoft.NET.Sdk.StaticWebAssets.Tests (195)
AspNetSdkBaselineTest.cs (2)
289ProjectDirectory.Path, 297var template = Templatize(actual, ProjectDirectory.Path, GetNuGetCachePath() ?? TestContext.Current.NuGetCachePath, runtimeIdentifier);
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
ScopedCssIntegrationTests.cs (9)
81var stylesFolder = Path.Combine(projectDirectory.Path, "Styles", "Pages"); 84File.Move(Path.Combine(projectDirectory.Path, "Components", "Pages", "Counter.razor.css"), styles); 276File.Delete(Path.Combine(projectDirectory.Path, "Components", "Pages", "Counter.razor.css")); 277File.Delete(Path.Combine(projectDirectory.Path, "Components", "Pages", "Index.razor.css")); 326File.Delete(Path.Combine(projectDirectory.Path, "Components", "Pages", "Counter.razor.css")); 347File.Delete(Path.Combine(projectDirectory.Path, "Components", "Pages", "Counter.razor.css")); 348File.Delete(Path.Combine(projectDirectory.Path, "Components", "Pages", "Index.razor.css")); 590var scopedCssFile = Path.Combine(ProjectDirectory.Path, "AppWithPackageAndP2PReference", "Index.razor.css"); 592File.WriteAllText(Path.Combine(ProjectDirectory.Path, "AppWithPackageAndP2PReference", "Index.razor"), "This is a test razor component.");
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"));
StaticWebAssetsFingerprintingTest.cs (2)
26Directory.CreateDirectory(Path.Combine(ProjectDirectory.Path, "wwwroot", "css")); 27File.WriteAllText(Path.Combine(ProjectDirectory.Path, "wwwroot", "css", "fingerprint-site.css"), "body { color: red; }");
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)
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
Microsoft.NET.Sdk.WorkloadManifestReader.Tests (6)
ManifestReaderFunctionalTests.cs (1)
88var testFolder = _testAssetsManager.CreateTestDirectory().Path;
ManifestTests.cs (2)
94var testDirectory = _testAssetsManager.CreateTestDirectory(identifier: defaultExists.ToString() + "_" + additionalExists.ToString()).Path; 126var testDirectory = _testAssetsManager.CreateTestDirectory().Path;
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
SdkDirectoryWorkloadManifestProviderTests.cs (2)
27_testDirectory = _testAssetsManager.CreateTestDirectory(testName, identifier).Path; 1331var testDirectory = _testAssetsManager.CreateTestDirectory().Path;
Microsoft.NET.TestFramework (9)
AspNetSdkTest.cs (2)
65File.Copy(assetPath, Path.Combine(projectDirectory.Path, Path.GetFileName(assetPath))); 109var rebuild = new RebuildCommand(Log, asset.Path, relativePathToProject);
Commands\DotnetBuildCommand.cs (1)
35var projectPath = Path.Combine(TestAsset.Path, TestAsset.TestProject.Name);
ProjectConstruction\TestProject.cs (1)
131string targetFolder = Path.Combine(targetTestAsset.Path, Name ?? string.Empty);
TestAsset.cs (4)
16public string TestRoot => Path; 52var files = Directory.GetFiles(Path, "*.*", SearchOption.AllDirectories); 76Directory.CreateDirectory(sourceDir.Replace(_testAssetRoot ?? string.Empty, Path)); 87string destFile = srcFile.Replace(_testAssetRoot ?? string.Empty, Path);
TestDirectory.cs (1)
17EnsureExistsAndEmpty(Path, sdkVersion);
Microsoft.NET.ToolPack.Tests (4)
GivenThatWeWantToPackAToolProjectWithPackagedShim.cs (3)
261var buildCommand = new BuildCommand(testAsset).WithWorkingDirectory(testAsset.Path); 264var packCommand = new PackCommand(testAsset).WithWorkingDirectory(testAsset.Path) as PackCommand; 400var packCommand = new PackCommand(Log, Path.Combine(asset.Path, testProject.Name));
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
Microsoft.TemplateEngine.Cli.UnitTests (1)
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
Microsoft.WebTools.AspireService.Tests (1)
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
msbuild.Integration.Tests (7)
GivenDotnetInvokesMSBuild.cs (6)
25.WithWorkingDirectory(testInstance.Path) 41.WithWorkingDirectory(testInstance.Path) 62.WithWorkingDirectory(testInstance.Path) 79.WithWorkingDirectory(testInstance.Path) 93.WithWorkingDirectory(testInstance.Path) 106.WithWorkingDirectory(testInstance.Path)
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
System.CommandLine.StaticCompletions.Tests (1)
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;
trustedroots.Tests (1)
Program.cs (1)
72command.WorkingDirectory = testDirectory.Path;