Describe the bug
If you provide the MockFileSystem's DirectoryInfo.Wrap method with a DirectoryInfo that has an absolute path, the resulting IDirectoryInfo has the wrong file path.
To Reproduce
usingXunit;usingSystem.IO.Abstractions;usingSystem.IO.Abstractions.TestingHelpers;[Fact]publicvoidTest(){varfs=newMockFileSystem();vardirectoryInfo=newDirectoryInfo(@"C:\subfolder\file");varwrappedDirectoryInfo=fs.DirectoryInfo.Wrap(directoryInfo);Assert.Equal(directoryInfo.FullName,wrappedDirectoryInfo.FullName);// wrappedDirectoryInfo returns "C:\file"}Expected behaviour
The test above is expected to pass.
Actual behaviour
Assert.Equal() Failure
↓ (pos 3)
Expected: C:\subfolder\file
Actual: C:\file
↑ (pos 3)
Additional context
Tested on Windows 10, .Net 7, System.IO.Abstractions version 19.2.69
Describe the bug
If you provide the MockFileSystem's DirectoryInfo.Wrap method with a DirectoryInfo that has an absolute path, the resulting IDirectoryInfo has the wrong file path.
To Reproduce
Expected behaviour
The test above is expected to pass.
Actual behaviour
Additional context
Tested on Windows 10, .Net 7, System.IO.Abstractions version 19.2.69