From bf29359bba2390591d9abab4543806845e657294 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 1 Apr 2026 09:01:42 +0200 Subject: [PATCH 1/5] fix: MockFileSystem.GetTempPath() now returns real OS temp path by default Replace the hardcoded C:\temp\ constant (converted via XFS.Path) with System.IO.Path.GetTempPath() so the default mirrors the actual environment. Callers can still override by passing an explicit temp directory. Co-Authored-By: Claude Sonnet 4.6 (1M context) --- .../MockFileSystem.cs | 3 +-- .../MockPathTests.cs | 13 +++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/TestableIO.System.IO.Abstractions.TestingHelpers/MockFileSystem.cs b/src/TestableIO.System.IO.Abstractions.TestingHelpers/MockFileSystem.cs index fa5c57430..0cb2e7c0b 100644 --- a/src/TestableIO.System.IO.Abstractions.TestingHelpers/MockFileSystem.cs +++ b/src/TestableIO.System.IO.Abstractions.TestingHelpers/MockFileSystem.cs @@ -14,7 +14,6 @@ namespace System.IO.Abstractions.TestingHelpers; public class MockFileSystem : FileSystemBase, IMockFileDataAccessor { private const string DEFAULT_CURRENT_DIRECTORY = @"C:\"; - private const string TEMP_DIRECTORY = @"C:\temp\"; private readonly IDictionary files; private readonly IDictionary drives; @@ -58,7 +57,7 @@ public MockFileSystem(IDictionary files, MockFileSystemOpt throw new ArgumentException("Current directory needs to be rooted.", nameof(currentDirectory)); } - var defaultTempDirectory = XFS.Path(TEMP_DIRECTORY); + var defaultTempDirectory = System.IO.Path.GetTempPath(); StringOperations = new StringOperations(XFS.IsUnixPlatform()); pathVerifier = new PathVerifier(this); diff --git a/tests/TestableIO.System.IO.Abstractions.TestingHelpers.Tests/MockPathTests.cs b/tests/TestableIO.System.IO.Abstractions.TestingHelpers.Tests/MockPathTests.cs index e614de495..4e7e6f347 100644 --- a/tests/TestableIO.System.IO.Abstractions.TestingHelpers.Tests/MockPathTests.cs +++ b/tests/TestableIO.System.IO.Abstractions.TestingHelpers.Tests/MockPathTests.cs @@ -412,6 +412,19 @@ public async Task GetTempPath_Called_ReturnsStringLengthGreaterThanZero(string t await That(result.Length > 0).IsTrue(); } + [Test] + public async Task GetTempPath_Default_MatchesRealOsTempPath() + { + //Arrange + var mockPath = new MockFileSystem().Path; + + //Act + var result = mockPath.GetTempPath(); + + //Assert + await That(result).IsEqualTo(System.IO.Path.GetTempPath()); + } + [Test] public async Task GetTempPath_Called_WithNonNullVirtualTempDirectory_ReturnsVirtualTempDirectory() { From be27a00856cfb0d72c916dfc7840ac4ce7ea8e94 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 1 Apr 2026 09:27:56 +0200 Subject: [PATCH 2/5] fix: add TemporaryDirectory to MockFileSystemOptions Addresses CoPilot review feedback: the PR description referenced MockFileSystemOptions as a way to set a custom temp directory, but the option did not exist. Added TemporaryDirectory (nullable string) that, when set, is used instead of System.IO.Path.GetTempPath(). Co-Authored-By: Claude Sonnet 4.6 (1M context) --- .../MockFileSystem.cs | 4 +++- .../MockFileSystemOptions.cs | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/TestableIO.System.IO.Abstractions.TestingHelpers/MockFileSystem.cs b/src/TestableIO.System.IO.Abstractions.TestingHelpers/MockFileSystem.cs index 0cb2e7c0b..1b0822646 100644 --- a/src/TestableIO.System.IO.Abstractions.TestingHelpers/MockFileSystem.cs +++ b/src/TestableIO.System.IO.Abstractions.TestingHelpers/MockFileSystem.cs @@ -57,7 +57,9 @@ public MockFileSystem(IDictionary files, MockFileSystemOpt throw new ArgumentException("Current directory needs to be rooted.", nameof(currentDirectory)); } - var defaultTempDirectory = System.IO.Path.GetTempPath(); + var defaultTempDirectory = !string.IsNullOrEmpty(options.TemporaryDirectory) + ? options.TemporaryDirectory + : System.IO.Path.GetTempPath(); StringOperations = new StringOperations(XFS.IsUnixPlatform()); pathVerifier = new PathVerifier(this); diff --git a/src/TestableIO.System.IO.Abstractions.TestingHelpers/MockFileSystemOptions.cs b/src/TestableIO.System.IO.Abstractions.TestingHelpers/MockFileSystemOptions.cs index f6f19dbf3..7ac956f05 100644 --- a/src/TestableIO.System.IO.Abstractions.TestingHelpers/MockFileSystemOptions.cs +++ b/src/TestableIO.System.IO.Abstractions.TestingHelpers/MockFileSystemOptions.cs @@ -14,4 +14,10 @@ public class MockFileSystemOptions /// Flag indicating, if a temporary directory should be created. /// public bool CreateDefaultTempDir { get; init; } = true; + + /// + /// The temp directory returned by on the . + /// Defaults to when or empty. + /// + public string? TemporaryDirectory { get; init; } } \ No newline at end of file From 45889b4bdcd042156112665a05ab0fcd1e248ad3 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 1 Apr 2026 12:09:52 +0200 Subject: [PATCH 3/5] fix: remove nullable annotation from TemporaryDirectory The project does not enable nullable reference types, so string? causes CS8632 across all target frameworks. Plain string with IsNullOrEmpty guard achieves the same result. Co-Authored-By: Claude Sonnet 4.6 (1M context) --- .../MockFileSystemOptions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TestableIO.System.IO.Abstractions.TestingHelpers/MockFileSystemOptions.cs b/src/TestableIO.System.IO.Abstractions.TestingHelpers/MockFileSystemOptions.cs index 7ac956f05..b3a9668a1 100644 --- a/src/TestableIO.System.IO.Abstractions.TestingHelpers/MockFileSystemOptions.cs +++ b/src/TestableIO.System.IO.Abstractions.TestingHelpers/MockFileSystemOptions.cs @@ -19,5 +19,5 @@ public class MockFileSystemOptions /// The temp directory returned by on the . /// Defaults to when or empty. /// - public string? TemporaryDirectory { get; init; } + public string TemporaryDirectory { get; init; } } \ No newline at end of file From 4c004fc73ebcf162e2e75441529c5226bcce51ed Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Thu, 2 Apr 2026 19:49:05 +0200 Subject: [PATCH 4/5] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks @vbreuss applied your updates ! Co-authored-by: Valentin Breuß --- .../MockFileSystemOptions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TestableIO.System.IO.Abstractions.TestingHelpers/MockFileSystemOptions.cs b/src/TestableIO.System.IO.Abstractions.TestingHelpers/MockFileSystemOptions.cs index b3a9668a1..791e4c2ab 100644 --- a/src/TestableIO.System.IO.Abstractions.TestingHelpers/MockFileSystemOptions.cs +++ b/src/TestableIO.System.IO.Abstractions.TestingHelpers/MockFileSystemOptions.cs @@ -16,8 +16,8 @@ public class MockFileSystemOptions public bool CreateDefaultTempDir { get; init; } = true; /// - /// The temp directory returned by on the . + /// The temporary directory used by the . /// Defaults to when or empty. /// - public string TemporaryDirectory { get; init; } + public string? TemporaryDirectory { get; init; } } \ No newline at end of file From 217a1d78024029af483d2e461447d32c10403cef Mon Sep 17 00:00:00 2001 From: mpdreamz Date: Wed, 30 Sep 2026 21:51:38 +0200 Subject: [PATCH 5/5] fix: make the build pass for the real temp path default - `TemporaryDirectory` is a plain `string`: the project has no nullable annotation context, so `string?` failed to compile on every target. - The expected public API lists `MockFileSystemOptions.TemporaryDirectory`. - Tests that relied on `C:\temp` existing by default now use the file system's temp path, or opt out of the default temp directory where they count entries under the root. - A test covers `TemporaryDirectory`: it is returned by `GetTempPath()` and created. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01TymoqrVYgZwdNSper5ZZB1 --- .../MockFileSystemOptions.cs | 2 +- ...tem.IO.Abstractions.TestingHelpers_net10.0.txt | 1 + ...stem.IO.Abstractions.TestingHelpers_net472.txt | 1 + ...stem.IO.Abstractions.TestingHelpers_net6.0.txt | 1 + ...stem.IO.Abstractions.TestingHelpers_net8.0.txt | 1 + ...stem.IO.Abstractions.TestingHelpers_net9.0.txt | 1 + ...Abstractions.TestingHelpers_netstandard2.0.txt | 1 + ...Abstractions.TestingHelpers_netstandard2.1.txt | 1 + .../MockDirectoryInfoTests.cs | 4 ++-- .../MockFileInfoTests.cs | 6 +++--- .../MockFileSystemTests.cs | 4 ++-- .../MockPathTests.cs | 15 +++++++++++++++ 12 files changed, 30 insertions(+), 8 deletions(-) diff --git a/src/TestableIO.System.IO.Abstractions.TestingHelpers/MockFileSystemOptions.cs b/src/TestableIO.System.IO.Abstractions.TestingHelpers/MockFileSystemOptions.cs index 791e4c2ab..64b851d2e 100644 --- a/src/TestableIO.System.IO.Abstractions.TestingHelpers/MockFileSystemOptions.cs +++ b/src/TestableIO.System.IO.Abstractions.TestingHelpers/MockFileSystemOptions.cs @@ -19,5 +19,5 @@ public class MockFileSystemOptions /// The temporary directory used by the . /// Defaults to when or empty. /// - public string? TemporaryDirectory { get; init; } + public string TemporaryDirectory { get; init; } } \ No newline at end of file diff --git a/tests/TestableIO.System.IO.Abstractions.Api.Tests/Expected/TestableIO.System.IO.Abstractions.TestingHelpers_net10.0.txt b/tests/TestableIO.System.IO.Abstractions.Api.Tests/Expected/TestableIO.System.IO.Abstractions.TestingHelpers_net10.0.txt index 9e26f088d..1a6969e3d 100644 --- a/tests/TestableIO.System.IO.Abstractions.Api.Tests/Expected/TestableIO.System.IO.Abstractions.TestingHelpers_net10.0.txt +++ b/tests/TestableIO.System.IO.Abstractions.Api.Tests/Expected/TestableIO.System.IO.Abstractions.TestingHelpers_net10.0.txt @@ -485,6 +485,7 @@ namespace System.IO.Abstractions.TestingHelpers public MockFileSystemOptions() { } public bool CreateDefaultTempDir { get; init; } public string CurrentDirectory { get; init; } + public string TemporaryDirectory { get; init; } } [System.Serializable] public class MockFileSystemWatcherFactory : System.IO.Abstractions.IFileSystemEntity, System.IO.Abstractions.IFileSystemWatcherFactory diff --git a/tests/TestableIO.System.IO.Abstractions.Api.Tests/Expected/TestableIO.System.IO.Abstractions.TestingHelpers_net472.txt b/tests/TestableIO.System.IO.Abstractions.Api.Tests/Expected/TestableIO.System.IO.Abstractions.TestingHelpers_net472.txt index e64a25b2e..ebf947270 100644 --- a/tests/TestableIO.System.IO.Abstractions.Api.Tests/Expected/TestableIO.System.IO.Abstractions.TestingHelpers_net472.txt +++ b/tests/TestableIO.System.IO.Abstractions.Api.Tests/Expected/TestableIO.System.IO.Abstractions.TestingHelpers_net472.txt @@ -388,6 +388,7 @@ namespace System.IO.Abstractions.TestingHelpers public MockFileSystemOptions() { } public bool CreateDefaultTempDir { get; init; } public string CurrentDirectory { get; init; } + public string TemporaryDirectory { get; init; } } [System.Serializable] public class MockFileSystemWatcherFactory : System.IO.Abstractions.IFileSystemEntity, System.IO.Abstractions.IFileSystemWatcherFactory diff --git a/tests/TestableIO.System.IO.Abstractions.Api.Tests/Expected/TestableIO.System.IO.Abstractions.TestingHelpers_net6.0.txt b/tests/TestableIO.System.IO.Abstractions.Api.Tests/Expected/TestableIO.System.IO.Abstractions.TestingHelpers_net6.0.txt index b02c1735a..3bf8d36fe 100644 --- a/tests/TestableIO.System.IO.Abstractions.Api.Tests/Expected/TestableIO.System.IO.Abstractions.TestingHelpers_net6.0.txt +++ b/tests/TestableIO.System.IO.Abstractions.Api.Tests/Expected/TestableIO.System.IO.Abstractions.TestingHelpers_net6.0.txt @@ -447,6 +447,7 @@ namespace System.IO.Abstractions.TestingHelpers public MockFileSystemOptions() { } public bool CreateDefaultTempDir { get; init; } public string CurrentDirectory { get; init; } + public string TemporaryDirectory { get; init; } } [System.Serializable] public class MockFileSystemWatcherFactory : System.IO.Abstractions.IFileSystemEntity, System.IO.Abstractions.IFileSystemWatcherFactory diff --git a/tests/TestableIO.System.IO.Abstractions.Api.Tests/Expected/TestableIO.System.IO.Abstractions.TestingHelpers_net8.0.txt b/tests/TestableIO.System.IO.Abstractions.Api.Tests/Expected/TestableIO.System.IO.Abstractions.TestingHelpers_net8.0.txt index a5a8f2770..ac31d092f 100644 --- a/tests/TestableIO.System.IO.Abstractions.Api.Tests/Expected/TestableIO.System.IO.Abstractions.TestingHelpers_net8.0.txt +++ b/tests/TestableIO.System.IO.Abstractions.Api.Tests/Expected/TestableIO.System.IO.Abstractions.TestingHelpers_net8.0.txt @@ -471,6 +471,7 @@ namespace System.IO.Abstractions.TestingHelpers public MockFileSystemOptions() { } public bool CreateDefaultTempDir { get; init; } public string CurrentDirectory { get; init; } + public string TemporaryDirectory { get; init; } } [System.Serializable] public class MockFileSystemWatcherFactory : System.IO.Abstractions.IFileSystemEntity, System.IO.Abstractions.IFileSystemWatcherFactory diff --git a/tests/TestableIO.System.IO.Abstractions.Api.Tests/Expected/TestableIO.System.IO.Abstractions.TestingHelpers_net9.0.txt b/tests/TestableIO.System.IO.Abstractions.Api.Tests/Expected/TestableIO.System.IO.Abstractions.TestingHelpers_net9.0.txt index 00e02741d..b2cd7b886 100644 --- a/tests/TestableIO.System.IO.Abstractions.Api.Tests/Expected/TestableIO.System.IO.Abstractions.TestingHelpers_net9.0.txt +++ b/tests/TestableIO.System.IO.Abstractions.Api.Tests/Expected/TestableIO.System.IO.Abstractions.TestingHelpers_net9.0.txt @@ -485,6 +485,7 @@ namespace System.IO.Abstractions.TestingHelpers public MockFileSystemOptions() { } public bool CreateDefaultTempDir { get; init; } public string CurrentDirectory { get; init; } + public string TemporaryDirectory { get; init; } } [System.Serializable] public class MockFileSystemWatcherFactory : System.IO.Abstractions.IFileSystemEntity, System.IO.Abstractions.IFileSystemWatcherFactory diff --git a/tests/TestableIO.System.IO.Abstractions.Api.Tests/Expected/TestableIO.System.IO.Abstractions.TestingHelpers_netstandard2.0.txt b/tests/TestableIO.System.IO.Abstractions.Api.Tests/Expected/TestableIO.System.IO.Abstractions.TestingHelpers_netstandard2.0.txt index 1dc0ed02e..8d6cece7b 100644 --- a/tests/TestableIO.System.IO.Abstractions.Api.Tests/Expected/TestableIO.System.IO.Abstractions.TestingHelpers_netstandard2.0.txt +++ b/tests/TestableIO.System.IO.Abstractions.Api.Tests/Expected/TestableIO.System.IO.Abstractions.TestingHelpers_netstandard2.0.txt @@ -388,6 +388,7 @@ namespace System.IO.Abstractions.TestingHelpers public MockFileSystemOptions() { } public bool CreateDefaultTempDir { get; init; } public string CurrentDirectory { get; init; } + public string TemporaryDirectory { get; init; } } [System.Serializable] public class MockFileSystemWatcherFactory : System.IO.Abstractions.IFileSystemEntity, System.IO.Abstractions.IFileSystemWatcherFactory diff --git a/tests/TestableIO.System.IO.Abstractions.Api.Tests/Expected/TestableIO.System.IO.Abstractions.TestingHelpers_netstandard2.1.txt b/tests/TestableIO.System.IO.Abstractions.Api.Tests/Expected/TestableIO.System.IO.Abstractions.TestingHelpers_netstandard2.1.txt index cba08bc11..0a86625e3 100644 --- a/tests/TestableIO.System.IO.Abstractions.Api.Tests/Expected/TestableIO.System.IO.Abstractions.TestingHelpers_netstandard2.1.txt +++ b/tests/TestableIO.System.IO.Abstractions.Api.Tests/Expected/TestableIO.System.IO.Abstractions.TestingHelpers_netstandard2.1.txt @@ -418,6 +418,7 @@ namespace System.IO.Abstractions.TestingHelpers public MockFileSystemOptions() { } public bool CreateDefaultTempDir { get; init; } public string CurrentDirectory { get; init; } + public string TemporaryDirectory { get; init; } } [System.Serializable] public class MockFileSystemWatcherFactory : System.IO.Abstractions.IFileSystemEntity, System.IO.Abstractions.IFileSystemWatcherFactory diff --git a/tests/TestableIO.System.IO.Abstractions.TestingHelpers.Tests/MockDirectoryInfoTests.cs b/tests/TestableIO.System.IO.Abstractions.TestingHelpers.Tests/MockDirectoryInfoTests.cs index bed4d6702..015352e7f 100644 --- a/tests/TestableIO.System.IO.Abstractions.TestingHelpers.Tests/MockDirectoryInfoTests.cs +++ b/tests/TestableIO.System.IO.Abstractions.TestingHelpers.Tests/MockDirectoryInfoTests.cs @@ -219,7 +219,7 @@ public async Task MockDirectoryInfo_EnumerateFileSystemInfos_ShouldReturnDirecto { XFS.Path(@"c:\temp\folder\file.txt"), new MockFileData("") }, { XFS.Path(@"c:\temp\folder\folder"), new MockDirectoryData() }, { XFS.Path(@"c:\temp\folder\older"), new MockDirectoryData() } - }); + }, new MockFileSystemOptions { CreateDefaultTempDir = false }); var directoryInfo = new MockDirectoryInfo(fileSystem, XFS.Path(@"c:\")); var result = directoryInfo.EnumerateFileSystemInfos("*", SearchOption.AllDirectories).ToArray(); @@ -236,7 +236,7 @@ public async Task MockDirectoryInfo_EnumerateFileSystemInfos_ShouldReturnDirecto { XFS.Path(@"c:\temp\folder\file.txt"), new MockFileData("") }, { XFS.Path(@"c:\temp\folder\folder"), new MockDirectoryData() }, { XFS.Path(@"c:\temp\folder\older"), new MockDirectoryData() } - }); + }, new MockFileSystemOptions { CreateDefaultTempDir = false }); var directoryInfo = new MockDirectoryInfo(fileSystem, XFS.Path(@"c:\")); diff --git a/tests/TestableIO.System.IO.Abstractions.TestingHelpers.Tests/MockFileInfoTests.cs b/tests/TestableIO.System.IO.Abstractions.TestingHelpers.Tests/MockFileInfoTests.cs index 55a7b1f01..bf0492476 100644 --- a/tests/TestableIO.System.IO.Abstractions.TestingHelpers.Tests/MockFileInfoTests.cs +++ b/tests/TestableIO.System.IO.Abstractions.TestingHelpers.Tests/MockFileInfoTests.cs @@ -907,7 +907,7 @@ public async Task MockFileInfo_Exists_ShouldUpdateCachedDataOnRefresh() public async Task MockFileInfo_Create_ShouldUpdateCachedDataAndReturnTrueForExists() { IFileSystem fileSystem = new MockFileSystem(); - var path = XFS.Path(@"c:\temp\file1.txt"); + var path = fileSystem.Path.Combine(fileSystem.Path.GetTempPath(), "file1.txt"); IFileInfo fileInfo = fileSystem.FileInfo.New(path); // Act @@ -922,7 +922,7 @@ public async Task MockFileInfo_Create_ShouldUpdateCachedDataAndReturnTrueForExis public async Task MockFileInfo_CreateText_ShouldUpdateCachedDataAndReturnTrueForExists() { IFileSystem fileSystem = new MockFileSystem(); - var path = XFS.Path(@"c:\temp\file1.txt"); + var path = fileSystem.Path.Combine(fileSystem.Path.GetTempPath(), "file1.txt"); IFileInfo fileInfo = fileSystem.FileInfo.New(path); // Act @@ -936,7 +936,7 @@ public async Task MockFileInfo_CreateText_ShouldUpdateCachedDataAndReturnTrueFor public async Task MockFileInfo_Delete_ShouldUpdateCachedDataAndReturnFalseForExists() { var fileSystem = new MockFileSystem(); - var path = XFS.Path(@"c:\temp\file1.txt"); + var path = fileSystem.Path.Combine(fileSystem.Path.GetTempPath(), "file1.txt"); IFileInfo fileInfo = fileSystem.FileInfo.New(path); // Act diff --git a/tests/TestableIO.System.IO.Abstractions.TestingHelpers.Tests/MockFileSystemTests.cs b/tests/TestableIO.System.IO.Abstractions.TestingHelpers.Tests/MockFileSystemTests.cs index 7252317cd..f2564ba42 100644 --- a/tests/TestableIO.System.IO.Abstractions.TestingHelpers.Tests/MockFileSystemTests.cs +++ b/tests/TestableIO.System.IO.Abstractions.TestingHelpers.Tests/MockFileSystemTests.cs @@ -396,7 +396,7 @@ public async Task MockFileSystem_AllNodes_ShouldReturnAllNodes() XFS.Path(@"c:\something\other.gif"), XFS.Path(@"d:\foobar"), XFS.Path(@"d:\foo\bar"), - XFS.Path(@"C:\temp") + fileSystem.Path.GetTempPath().TrimEnd(fileSystem.Path.DirectorySeparatorChar) }; var result = fileSystem.AllNodes; @@ -510,7 +510,7 @@ public async Task MockFileSystem_Constructor_ShouldNotDuplicateDrives() [Test] public async Task MockFileSystem_DefaultState_DefaultTempDirectoryExists() { - var tempDirectory = XFS.Path(@"C:\temp"); + var tempDirectory = System.IO.Path.GetTempPath(); var mockFileSystem = new MockFileSystem(); var mockFileSystemOverload = new MockFileSystem(null, string.Empty); diff --git a/tests/TestableIO.System.IO.Abstractions.TestingHelpers.Tests/MockPathTests.cs b/tests/TestableIO.System.IO.Abstractions.TestingHelpers.Tests/MockPathTests.cs index 4e7e6f347..be5f0f7f6 100644 --- a/tests/TestableIO.System.IO.Abstractions.TestingHelpers.Tests/MockPathTests.cs +++ b/tests/TestableIO.System.IO.Abstractions.TestingHelpers.Tests/MockPathTests.cs @@ -425,6 +425,21 @@ public async Task GetTempPath_Default_MatchesRealOsTempPath() await That(result).IsEqualTo(System.IO.Path.GetTempPath()); } + [Test] + public async Task GetTempPath_WithTemporaryDirectoryOption_ReturnsAndCreatesIt() + { + //Arrange + var temporaryDirectory = XFS.Path(@"C:\custom\temp\"); + var fileSystem = new MockFileSystem(new MockFileSystemOptions { TemporaryDirectory = temporaryDirectory }); + + //Act + var result = fileSystem.Path.GetTempPath(); + + //Assert + await That(result).IsEqualTo(temporaryDirectory); + await That(fileSystem.Directory.Exists(temporaryDirectory)).IsTrue(); + } + [Test] public async Task GetTempPath_Called_WithNonNullVirtualTempDirectory_ReturnsVirtualTempDirectory() {