Repository navigation
Stop calling real IO.Path.GetTempPath() when creating a MockFileSystem - #372
Conversation
|
Thanks for your contribution, generally this seems like a safe and valuable change to make. Could you please verify that a scenario like the one mentioned in #350 (comment) will work with your change? |
|
I'm not exactly sure how to prove it will fix that. void Test...() {
var fs = new MockFileSystem();
var dirInfo = fs.DirectoryInfo.FromDirectoryName(".");
}However, no exception was thrown. I think you would need to have the real The test What are your thoughts? |
|
I'd expect the linked snippet to blow up with our current release because the temp directory does not exist in the |
|
@tehmantra What about adding a test like this: public void MockFileSystem_DefaultState_CurrentDirectoryExists()
{
var fs = new MockFileSystem();
var currentDirectory = fs.DirectoryInfo.FromDirectoryName(".");
Assert.IsTrue(currentDirectory.Exists);
}That should ensure that we can use the current directory safely after constructing the |
|
@fgreinacher Cheers. |
|
Thanks for your work @tehmantra! |
Fixes: #350
Tried to do this with the smallest change possible.
Hard-coding to
"C:\"(which will get translated to"/"on unix) as per discussion on the issue.Let me know if this is okay.