Skip to content

Conversation

@updateaman
Copy link
Contributor

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

Copy link
Contributor

@fgreinacher fgreinacher left a 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)]
Copy link
Contributor

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.

Copy link
Contributor

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";
Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fgreinacher
Copy link
Contributor

@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!

@fgreinacher fgreinacher merged commit a2062c9 into TestableIO:master Jan 5, 2019
@fgreinacher fgreinacher mentioned this pull request Jan 5, 2019
fgreinacher added a commit that referenced this pull request Jan 5, 2019
- 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
@updateaman
Copy link
Contributor Author

Thank you for sorting this out

@updateaman updateaman deleted the bug/428-mockdirectory-delete branch June 23, 2019 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants