Skip to content

Commit 7a93295

Browse files
vbreussvbtig
andauthored
coverage: add test for isreadonly on missing fileinfo (#233)
Based on TestableIO/System.IO.Abstractions#942 add a test for correct behaviour of `FileInfo.IsReadOnly` when the file does not exist. --------- Co-authored-by: Valentin Breuß <[email protected]>
1 parent 215bda6 commit 7a93295

File tree

1 file changed

+9
-0
lines changed
  • Tests/Testably.Abstractions.Tests/FileSystem/FileInfo

1 file changed

+9
-0
lines changed

Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/Tests.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,15 @@ public void Extension_WithTrailingDot_ShouldReturnExpectedValue()
8585
}
8686
}
8787

88+
[SkippableTheory]
89+
[AutoData]
90+
public void IsReadOnly_MissingFile_ShouldBeTrue(string path)
91+
{
92+
IFileInfo fileInfo = FileSystem.FileInfo.New(path);
93+
94+
fileInfo.IsReadOnly.Should().BeTrue();
95+
}
96+
8897
[SkippableTheory]
8998
[AutoData]
9099
public void IsReadOnly_SetToFalse_ShouldRemoveReadOnlyAttribute(string path)

0 commit comments

Comments
 (0)