Skip to content

Incorrect failure message for GenericDictionaryAssertions<,,>.ContainKeys #2137

@bkoelman

Description

@bkoelman

Description

The failure message for ContainKeys refers to "key" instead of "keys" when multiple keys are specified. For example:

Expected dictionary {["description"] = "Cupiditate deserunt et.", ["priority"] = TodoItemPriority.High {value: 1}, ["durationInHours"] = 31L, ["createdAt"] = <2019-03-31 01:46:13.529 +0h>, ["modifiedAt"] = <2019-12-21 14:52:31.497 +0h>} to contain key {"description", "priority", "durationInHours", "createdAt", "lastModifiedAt"}, but could not find {"lastModifiedAt"}.

The text "to contain key" should be: "to contain keys". Source code at https://github.com/fluentassertions/fluentassertions/blob/develop/Src/FluentAssertions/Collections/GenericDictionaryAssertions.cs#L312.

Reproduction Steps

See description.

Expected behavior

See description.

Actual behavior

See description.

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions