File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
src/TestableIO.System.IO.Abstractions.TestingHelpers Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ public MockFileStream(
5555 ThrowIfInvalidModeAccess ( mode , access ) ;
5656
5757 this . mockFileDataAccessor = mockFileDataAccessor ?? throw new ArgumentNullException ( nameof ( mockFileDataAccessor ) ) ;
58- path = path . Replace ( Path . AltDirectorySeparatorChar , Path . DirectorySeparatorChar ) . TrimSlashes ( ) ;
58+ path = NormalizePath ( path ) ;
5959 this . path = path ;
6060 this . options = options ;
6161
@@ -360,4 +360,15 @@ private TimeAdjustments GetTimeAdjustmentsForFileStreamWhenFileExists(FileMode m
360360 return TimeAdjustments . None ;
361361 }
362362 }
363+
364+ private string NormalizePath ( string path )
365+ {
366+ var normalizedPath = path
367+ . Replace (
368+ mockFileDataAccessor . Path . AltDirectorySeparatorChar ,
369+ mockFileDataAccessor . Path . DirectorySeparatorChar )
370+ . TrimSlashes ( ) ;
371+ normalizedPath = mockFileDataAccessor . Path . GetFullPath ( normalizedPath ) ;
372+ return normalizedPath ;
373+ }
363374}
You can’t perform that action at this time.
0 commit comments