Skip to content

BeEquivalentTo does not report the because-phrase for dictionary mismatch #1449

@stevebroshar

Description

@stevebroshar

Description

When dictionaries do not match, BeEquivalentTo does fail the test as expected, but it does not report the because-phrase text.

See fiddle https://dotnetfiddle.net/XUtEn5

Complete minimal example reproducing the issue

var actual = new Dictionary<string, string> { { "b", "x" } };
var expected = new Dictionary<string, string> { { "c", "x" } };

actual.Should().BeEquivalentTo(expected, "b-phrase");

Expected behavior:

Logged output should include: b-phrase

Actual behavior:

Logged output: Expected actual to contain key "c".

Versions

  • Which version of Fluent Assertions are you using? Tried with latest: 6.0.0.0-alpha0001, as well as 5.10.3. Same results in both.
  • Which .NET runtime and version are you targeting? .NET Core 3.1.

Additional Information

I discovered this issue at the same time: #1450

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions