-
Notifications
You must be signed in to change notification settings - Fork 731
Closed
Labels
Description
Description
I've come across a few scenarios where I need to validate specific properties and property combinations on Stream instances. I noticed the library does not expose any custom validations for such types so I had to workaround it.
I'd like to see simple validations such as:
.BeWritable(stream.CanWrite).BeReadable(stream.CanRead).BeReadOnly(stream.CanRead && !stream.CanWrite).BeWriteOnly(stream.CanWrite && !stream.CanRead).BeSeekable(stream.CanSeek)
As well as potentially more advanced validations such as:
.HaveContentsEquivalentTo(byte[])(matches a givenbyte[]for readable streams)
Expected behavior:
stream.Should().BeReadOnly();Actual behavior:
using (new AssertionScope())
{
stream.CanRead.Should().BeTrue();
stream.CanWrite.Should().BeFalse();
}Versions
-
Which version of Fluent Assertions are you using?
5.10.3 -
Which .NET runtime and version are you targeting? E.g. .NET framework 4.6.1 or .NET Core 2.1.
Net Core 3.1 / Net 5
Additional Information
Related to #961
dennisdoomen