Description
When asserting on properties of type ushort, short, and byte, the failure message is slightly more difficult to read than with other unsigned number types.
Reproduction Steps
record Foo(string Text, ushort Number); // `Number` can be ushort, short, or byte
// Arrange
var foo = new Foo("bar", 42);
// Assert
foo.Should().Match<Foo>(x => x.Number < 32 && x.Number > 45);
Expected behavior
The failure message should read:
Expected object to match (x.Number < 32) AndAlso (x.Number > 45), but found Foo
{
Number = 42us,
Text = "bar"
}.
Actual behavior
The actual failure message reads:
Expected object to match (Convert(x.Number, Int32) < 32) AndAlso (Convert(x.Number, Int32) > 45), but found Foo
{
Number = 42us,
Text = "bar"
}.
Regression?
No response
Known Workarounds
No response
Configuration
FluentAssertions 6.12.0
.NET 8.0
Other information
Other number types besides ushort, short, and byte displays a more readable failure message.
Are you willing to help with a pull-request?
No
Description
When asserting on properties of type
ushort,short, andbyte, the failure message is slightly more difficult to read than with other unsigned number types.Reproduction Steps
Expected behavior
The failure message should read:
Actual behavior
The actual failure message reads:
Regression?
No response
Known Workarounds
No response
Configuration
FluentAssertions 6.12.0
.NET 8.0
Other information
Other number types besides
ushort,short, andbytedisplays a more readable failure message.Are you willing to help with a pull-request?
No