New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend Idioms page to include new support for IEqualityComparer<T>
#36
Conversation
docs/autofixture/idioms.md
Outdated
@@ -187,7 +187,7 @@ Specifically, these assertions are available: | |||
* `EqualsSuccessiveAssertion` verifies that `Object.Equals` is implemented so that calling `x.Equals(y)` several times returns always the same value, | |||
* `GetHashCodeSuccessiveAssertion` verifies that `Object.GetHashCode` is implemented so that calling `x.GetHashCode()` several times returns always the same value. | |||
|
|||
As of today, developers are left to write unit tests that prove that the symmetric and transitive properties are respected. | |||
As of today, developers are left to write unit tests that prove that the symmetric and transitive properties are respected. [This package](https://www.nuget.org/packages/EqualityTests/) contains the missing tests. Since it's based on AutoFixture 3.36, it might not work with newer versions but developers can take inspiration from [its source code](https://github.com/baks/EqualityTests). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid that the phrase
contains the missing tests
is not really clear. In what aspect are the tests missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Earlier I have specified the properties must be enforced for a good equality check. AutoFixture does not include idiomatic assertions for all of them. The package I linked adds the missing ones.
@@ -187,7 +187,7 @@ Specifically, these assertions are available: | |||
* `EqualsSuccessiveAssertion` verifies that `Object.Equals` is implemented so that calling `x.Equals(y)` several times returns always the same value, | |||
* `GetHashCodeSuccessiveAssertion` verifies that `Object.GetHashCode` is implemented so that calling `x.GetHashCode()` several times returns always the same value. | |||
|
|||
As of today, developers are left to write unit tests that prove that the symmetric and transitive properties are respected. | |||
As of today, developers are left to write unit tests that prove that the symmetric and transitive properties are respected but they can be found in [this package](https://www.nuget.org/packages/EqualityTests/). Since this package is based on AutoFixture 3.36, it might not work with newer versions but developers can take inspiration from [its source code](https://github.com/baks/EqualityTests). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it clearer now? @agnerh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, much better thanks
This PR adds a paragraph to the Idioms page that shows how to use the new
EqualityComparerAssertion
introduced in AutoFixture 4.14.0.It also adds a link to the package EqualityTests by baks.
Fixes #35