Skip to content

Conversation

@robkeim
Copy link
Contributor

@robkeim robkeim commented Oct 16, 2018

Fixes #367

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 few minor nits.

}

[Test]
public void MockFileSystem_GetFiles_ThrowsCorrectExceptionForInvalidCharacters()
Copy link
Contributor

Choose a reason for hiding this comment

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

I prefer to be specific in the naming, so what about that:

Suggested change
public void MockFileSystem_GetFiles_ThrowsCorrectExceptionForInvalidCharacters()
public void MockFileSystem_GetFiles_ThrowsArgumentExceptionForInvalidCharacters()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense

fileSystem.AddDirectory(XFS.Path(path));

// Act
TestDelegate wrapped = () => fileSystem.Directory.GetFiles($"{path}{'\0'}.txt");
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't like the name wrapped - maybe something like getFilesWithInvalidCharacterInPath?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed

if(path == null)
if (path == null)
{
throw new ArgumentNullException();
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add argument name

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done


if (path.Any(c => Path.GetInvalidPathChars().Contains(c)))
{
throw new ArgumentException();
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add argument name and message.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@robkeim
Copy link
Contributor Author

robkeim commented Oct 19, 2018

Thanks @fgreinacher for the review. I integrated your feedback and pushed a new commit so you should be able to review again.

@fgreinacher
Copy link
Contributor

Thanks, looks great now!

@fgreinacher fgreinacher merged commit cd4d0ea into TestableIO:master Oct 20, 2018
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