-
Notifications
You must be signed in to change notification settings - Fork 731
Closed
Description
Description
When comparing the values of dictionaries for equivalency, the because message is not included in the failure message.
Reproduction Steps
var subject = new Dictionary<string, object>
{
["a"] = new List<int>()
};
var expected = new Dictionary<string, object>
{
["a"] = new List<int> { 42 }
};
subject.Should().BeEquivalentTo(expected, "FOO");Expected behavior
Exception message should include FOO
Actual behavior
FluentAssertions.Execution.AssertionFailedException: 'Expected subject[a] to be a collection with 1 item(s), but found an empty collection.
With configuration:
- Use declared types and members
- Compare enums by value
- Compare tuples by their properties
- Compare anonymous types by their properties
- Compare records by their members
- Include non-browsable members
- Match member by name (or throw)
- Be strict about the order of items in byte arrays
- Without automatic conversion.
'
Regression?
no
Known Workarounds
No response
Configuration
Fluent Assertions 6.12
.NET 8.0
Other information
No response
Could you help with a pull-request?
Yes