-
Notifications
You must be signed in to change notification settings - Fork 267
Bug/428 mockdirectory delete #433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug/428 mockdirectory delete #433
Conversation
fgreinacher
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot! Will merge as soon as my comments are addressed.
| } | ||
|
|
||
| [Test] | ||
| [WindowsOnly(WindowsSpecifics.CaseInsensitivity)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this test windows-only? I don't see anything windows-specific in there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| public void MockDirectory_Delete_ShouldNotDeleteAllDirectories() | ||
| { | ||
| // Arrange | ||
| var folder1Path = @"D:\Test\Program"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you create the path strings via XFS.Path("...") it will work x-plat.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
@updateaman I added some commits to make the tests work cross-platform. Merging as soon as CI is green. Thanks a lot for your contribution! |
- Do not throw exception when calling DirectoryInfoWrapper.Parent for the root directory (#430) by @wexman - Fix MockDirectoryInfo GetFiles for UNC paths caused by bug in StringExtensions.NormalizeSlashes (#422) by @DeveloperGuo - Pass IFileSystem into FileWrapper instead of FileSystem to allow replacement file systems to be used (#432) by @kirbatious - Make sure FileNotFound exceptions contain path and proper message (#427) by @fgreinacher - Do not delete directories that start with the same path (#433) by @updateaman
|
Thank you for sorting this out |
Fix for bug #428
Fixed the bug where Directory.Delete was deleting all similarly named directories.
Now it will only delete the directory and subdirectories