Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public override void Delete(string path, bool recursive)
/// <inheritdoc />
public override bool Exists(string path)
{
if (path == "/" && XFS.IsUnixPlatform())
if (path == "/")
{
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2181,7 +2181,7 @@ public async Task Move_Directory_DoesNotThrow_When_Target_Directory_Parent_Exist
string sourceDirName,
string targetDirName)
{
// Arange
// Arrange
var fileSystem = new MockFileSystem();
fileSystem.Directory.CreateDirectory(sourceDirName);

Expand All @@ -2192,4 +2192,16 @@ public async Task Move_Directory_DoesNotThrow_When_Target_Directory_Parent_Exist
await That(fileSystem.Directory.Exists(targetDirName)).IsTrue();
await That(fileSystem.Directory.Exists(sourceDirName)).IsFalse();
}

[Test]
public async Task MockDirectory_Exists_ShouldReturnTrue_IfArgIsFrontSlashAndRootDirExists()
{
string testDir = XFS.Path(@"c:\foo\bar\");
var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData>
{
{ testDir, new MockDirectoryData() }
});

await That(fileSystem.Directory.Exists("/")).IsEqualTo(true);
}
}