Description
When a type (class/struct) contains an empty ArraySegment<> struct,, some methods fail to work with it.
Specifically, when trying to serialize a message, it will fail with an InvalidOperationException.
I have a pull request solving it: #2445
Reproduction Steps
class MyClass
{
public ArraySegment<byte> ArraySegment { get; set; }
}
// Arrange
var expected = new MyClass();
var actual = new MyClass();
// Act
Action act = () => actual.Should().BeEquivalentTo(expected);
// Assert
act.Should().NotThrow();
Expected behavior
No crash when checking equivalency.
Actual behavior
An InvalidOperationException is thrown.
Regression?
No response
Known Workarounds
No response
Configuration
<PackageReference Include="FluentAssertions" Version="6.12.0" />
Other information
No response
Are you willing to help with a pull-request?
Yes, please assign this issue to me.