Skip to content

BeEquivalentTo with WithStrictOrdering produces messy failure message #918

@shuebner

Description

@shuebner

Description

Comparing collections with option "WithStrictOrdering" produces messy failure messages.

Complete minimal example reproducing the issue

new[] { 1, 2, 3 }.Should().BeEquivalentTo(new[] { 1, 3, 2 }, opts => opts.WithStrictOrdering());

Expected behavior:

Clear failure message about the difference between the lists.

Actual behavior:

Confusing and malformatted message with wrong statements:

Expected item[1] to be a collection with 3 item(s)Expected item[1] to be 3, but found 2.
Expected item[2] to be a collection with 3 item(s)Expected item[2] to be 2, but found 3.

Versions

FluentAssertions 5.4.2.0
.NET Framework 4.6.1

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions