Thanks to visit codestin.com
Credit goes to github.com

Skip to content

after update on 6.12.3, xy.Should().BeEquivalentTo cannot be used any more, has exception #2852

@D-Maier

Description

@D-Maier

Description

i use the method to test the equality of properties between two objects of the same class. Under version 6.12.2, it works flawlessly, but in version 6.12.3, the following exception occurs:

CS0176 Member 'object.Equals(object?, object?)' cannot be accessed with an instance reference; qualify it with a type name instead.

Reproduction Steps

_address.Should().BeEquivalentTo(
    compareAddress,
    o => o.Excluding(x => x.City).Excluding(x => x.CityReference).Excluding(x => x.ID)
    );

Expected behavior

Should return true or false.

Actual behavior

Exception CS0176 Member 'object.Equals(object?, object?)' cannot be accessed with an instance reference; qualify it with a type name instead. 

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

Are you willing to help with a pull-request?

No

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