You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
IDirectoryInfoFactory.Wrap loses part of absolute path when used with MockFileSystem #1049
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.
It looks like it's sending in directoryInfo.Name, which is only the dir name, not the full path.
I'd assume changing that to directoryInfo.FullName would fix it but I don't quite have time at the moment to verify that; maybe this weekend.
Activity
fgreinacher commentedon Jan 9, 2024
Thanks for reporting and sorry for the late response @koyote! Do you know if this has ever worked?
koyote commentedon Jan 9, 2024
Hi @fgreinacher, I do not, no.
I just recently started using this library and quickly encountered the above bug.
But just looking at the code for DirectoryInfo.Wrap:
It looks like it's sending in
directoryInfo.Name, which is only the dir name, not the full path.I'd assume changing that to
directoryInfo.FullNamewould fix it but I don't quite have time at the moment to verify that; maybe this weekend.vbreuss commentedon Jan 22, 2024
Please note, that the same issue also applies when wrapping a
FileInfo. I fixed both issues with #1079.fix: use correct path for wrapped `FileInfo` and `DirectoryInfo` (#1079)
github-actions commentedon Jan 22, 2024
This is addressed in release v20.0.15.