Skip to content

Set global ComparingByMembers/ComparingByValues #1757

Answered by dennisdoomen
SephVin asked this question in Q&A
Discussion options

You must be logged in to vote

It seems you're mixing up how FA compares two instances and how it renders the failure message. If your type, TestClass in this case, implements value equality (using Equals, IEquatable, etc), then we assume you want to compare two instances using those equality members. We will also use ToString to render the object in the failure message. You can customize that though. Check out the documentation on this here.

Replies: 4 comments 10 replies

Comment options

You must be logged in to vote
1 reply
@SephVin
Comment options

Comment options

You must be logged in to vote
1 reply
@SephVin
Comment options

Comment options

You must be logged in to vote
1 reply
@SephVin
Comment options

Answer selected by SephVin
Comment options

You must be logged in to vote
7 replies
@dennisdoomen
Comment options

@divega
Comment options

@dennisdoomen
Comment options

@divega
Comment options

@dennisdoomen
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #1756 on December 24, 2021 11:33.