Skip to content

Commit 02b74d1

Browse files
committed
test(MockDirectoryInfo.Exists): Add front slash test
1 parent 377312f commit 02b74d1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/TestableIO.System.IO.Abstractions.TestingHelpers.Tests/MockDirectoryInfoTests.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,4 +721,18 @@ public async Task MockDirectoryInfo_LastWriteTimeUtc_SetterShouldThrowDirectoryN
721721
await That(() => directoryInfo.LastWriteTime = newTime).Throws<DirectoryNotFoundException>();
722722
}
723723

724+
[Test]
725+
public async Task MockDirectoryInfo_Exists_ShouldReturnTrue_IfArgIsFrontSlashAndRootDirExists()
726+
{
727+
string testDir = XFS.Path(@"c:\foo\bar\");
728+
var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData>
729+
{
730+
{ testDir, new MockDirectoryData() }
731+
});
732+
733+
var dirInfo = fileSystem.DirectoryInfo.New("/");
734+
735+
await That(dirInfo.Exists).IsEqualTo(true);
736+
}
737+
724738
}

0 commit comments

Comments
 (0)