2 writes to Root
Microsoft.DotNet.Open.Api.Tools.Tests (2)
src\Tools\Shared\TestHelpers\TemporaryDirectory.cs (2)
21
Root
= Path.Combine(ResolveLinks(Path.GetTempPath()), "dotnet-tool-tests", Guid.NewGuid().ToString("N"));
27
Root
= path;
37 references to Root
Microsoft.DotNet.Open.Api.Tools.Tests (37)
OpenApiAddFileTests.cs (2)
45
Assert.Contains($"The project '{Path.Combine(_tempDir.
Root
, csproj)}' does not exist.", _error.ToString());
112
var absolute = Path.GetFullPath(nswagJsonFile, project.Project.Dir().
Root
);
OpenApiAddProjectTests.cs (1)
96
var refProjFile = Path.Join(refProj.
Root
, $"{refProjName}.csproj");
OpenApiAddURLTests.cs (12)
36
var jsonFile = Path.Combine(_tempDir.
Root
, expectedJsonName);
69
var jsonFile = Path.Combine(_tempDir.
Root
, expectedJsonName);
102
var jsonFile = Path.Combine(_tempDir.
Root
, expectedJsonName);
135
var jsonFile = Path.Combine(_tempDir.
Root
, expectedJsonName);
167
var jsonFile = Path.Combine(_tempDir.
Root
, expectedJsonName);
199
var firstJsonFile = Path.Combine(_tempDir.
Root
, firstExpectedJsonName);
227
var secondJsonFile = Path.Combine(_tempDir.
Root
, secondExpectedJsonName);
259
var resultFile = Path.Combine(_tempDir.
Root
, expectedJsonName);
291
var resultFile = Path.Combine(_tempDir.
Root
, expectedJsonName);
323
var resultFile = Path.Combine(_tempDir.
Root
, expectedJsonName);
356
var resultFile = Path.Combine(_tempDir.
Root
, expectedJsonName);
441
var jsonFile = Path.Combine(_tempDir.
Root
, expectedJsonName);
OpenApiRefreshTests.cs (3)
25
var expectedJsonPath = Path.Combine(_tempDir.
Root
, "filename.json");
55
var expectedJsonPath = Path.Combine(_tempDir.
Root
, "filename.json");
83
var expectedJsonPath = Path.Combine(_tempDir.
Root
, "filename.json");
OpenApiRemoveTests.cs (10)
32
var csproj = new FileInfo(Path.Join(_tempDir.
Root
, "testproj.csproj"));
47
csproj = new FileInfo(Path.Join(_tempDir.
Root
, "testproj.csproj"));
56
Assert.False(File.Exists(Path.Combine(_tempDir.
Root
, nswagJsonFile)));
75
var csproj = new FileInfo(Path.Join(_tempDir.
Root
, "testproj.csproj"));
90
csproj = new FileInfo(Path.Join(_tempDir.
Root
, "testproj.csproj"));
118
var refProjFile = Path.Join(refProj.
Root
, $"{refProjName}.csproj");
124
using (var csprojStream = new FileInfo(Path.Join(_tempDir.
Root
, "testproj.csproj")).OpenRead())
138
using (var csprojStream = new FileInfo(Path.Join(_tempDir.
Root
, "testproj.csproj")).OpenRead())
177
var csproj = new FileInfo(Path.Join(_tempDir.
Root
, "testproj.csproj"));
186
Assert.False(File.Exists(Path.Combine(_tempDir.
Root
, nswagJsonFile)));
OpenApiTestBase.cs (1)
87
_tempDir.
Root
, wrapper, _output, _error);
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (1)
30
public string Path => System.IO.Path.Combine(_directory.
Root
, _filename);
src\Tools\Shared\TestHelpers\TemporaryDirectory.cs (7)
32
var subdir = new TemporaryDirectory(Path.Combine(
Root
, name), this);
78
Directory.CreateDirectory(
Root
);
98
File.WriteAllText(Path.Combine(
Root
, filename), contents);
103
if (
Root
== null || !Directory.Exists(
Root
) || _parent != null)
110
Directory.Delete(
Root
, recursive: true);
114
Console.Error.WriteLine($"Test cleanup failed to delete '{
Root
}'");