Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ public override IDirectoryInfo CreateTempSubdirectory(string prefix = null)
// Perform directory name generation in a loop, just in case the randomly generated name already exists.
do
{
var randomDir = $"{prefix}{Path.GetRandomFileName()}";
potentialTempDirectory = Path.Combine(Path.GetTempPath(), randomDir);
var randomDir = $"{prefix}{FileSystem.Path.GetRandomFileName()}";
potentialTempDirectory = Path.Combine(FileSystem.Path.GetTempPath(), randomDir);
} while (Exists(potentialTempDirectory));

return CreateDirectoryInternal(potentialTempDirectory);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ public void MockDirectory_CreateTempSubdirectory_ShouldCreateSubdirectoryInTempD

// Assert
Assert.That(fileSystem.Directory.Exists(result.FullName), Is.True);
Assert.That(result.FullName.Contains(Path.GetTempPath()), Is.True);
Assert.That(result.FullName, Does.StartWith(fileSystem.Path.GetTempPath()));
}

[Test]
Expand All @@ -877,7 +877,7 @@ public void MockDirectory_CreateTempSubdirectoryWithPrefix_ShouldCreateDirectory
// Assert
Assert.That(fileSystem.Directory.Exists(result.FullName), Is.True);
Assert.That(Path.GetFileName(result.FullName).StartsWith("foo-"), Is.True);
Assert.That(result.FullName.Contains(Path.GetTempPath()), Is.True);
Assert.That(result.FullName.Contains(fileSystem.Path.GetTempPath()), Is.True);
}
#endif

Expand Down