Skip to content

Calling Equals on Assertion object does not fail so that the test suggests correctness #1705

@akacoding

Description

@akacoding

Calling

1.Should().Equals(2); // simple example

does not assert nor fail.
It is clear that this is the natural behavior because Equals does not belong to FluentAssertions but to the base object class.

But some users ran already in this kind of problem, see here on StackOverflow for example.

Proposal:
The Equals methods of all Assertion objects should throw or assert false with an appropiate message.
It would no longer be possible to write those wrong "assertion" statements with Equals because the test would fail.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions