@@ -11,6 +11,7 @@ namespace System.IO.Abstractions.TestingHelpers
1111 public class MockFileSystem : IFileSystem , IMockFileDataAccessor
1212 {
1313 private const string DEFAULT_CURRENT_DIRECTORY = @"C:\" ;
14+ private const string TEMP_DIRECTORY = @"C:\temp" ;
1415
1516 private readonly IDictionary < string , MockFileData > files ;
1617 private readonly PathVerifier pathVerifier ;
@@ -24,11 +25,13 @@ public MockFileSystem(IDictionary<string, MockFileData> files, string currentDir
2425 currentDirectory = XFS . Path ( DEFAULT_CURRENT_DIRECTORY ) ;
2526 }
2627
28+ var defaultTempDirectory = XFS . Path ( TEMP_DIRECTORY ) ;
29+
2730 StringOperations = new StringOperations ( XFS . IsUnixPlatform ( ) ) ;
2831 pathVerifier = new PathVerifier ( this ) ;
2932 this . files = new Dictionary < string , MockFileData > ( StringOperations . Comparer ) ;
3033
31- Path = new MockPath ( this ) ;
34+ Path = new MockPath ( this , defaultTempDirectory ) ;
3235 File = new MockFile ( this ) ;
3336 Directory = new MockDirectory ( this , currentDirectory ) ;
3437 FileInfo = new MockFileInfoFactory ( this ) ;
@@ -49,6 +52,11 @@ public MockFileSystem(IDictionary<string, MockFileData> files, string currentDir
4952 {
5053 AddDirectory ( currentDirectory ) ;
5154 }
55+
56+ if ( ! FileExists ( defaultTempDirectory ) )
57+ {
58+ AddDirectory ( defaultTempDirectory ) ;
59+ }
5260 }
5361
5462 public StringOperations StringOperations { get ; }
0 commit comments