Skip to content

Commit

Permalink
Small changes to EqualityComparerEqualsTransitiveAssertion
Browse files Browse the repository at this point in the history
  • Loading branch information
Kralizek committed Sep 5, 2020
1 parent 4d3b1b4 commit 8d41a0b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Src/Idioms/EqualityComparerEqualsTransitiveAssertion.cs
Expand Up @@ -50,13 +50,13 @@ protected override void VerifyEquals(MethodInfo methodInfo, Type argumentType)

var thirdTestSubject = this.Builder.CreateAnonymous(argumentType);

var firstResult = (bool)methodInfo.Invoke(comparer, new[] { firstTestSubject, secondTestSubject });
var firstToSecond = (bool)methodInfo.Invoke(comparer, new[] { firstTestSubject, secondTestSubject });

var secondResult = (bool)methodInfo.Invoke(comparer, new[] { secondTestSubject, thirdTestSubject });
var secondToThird = (bool)methodInfo.Invoke(comparer, new[] { secondTestSubject, thirdTestSubject });

var thirdResult = (bool)methodInfo.Invoke(comparer, new[] { firstTestSubject, thirdTestSubject });
var firstToThird = (bool)methodInfo.Invoke(comparer, new[] { firstTestSubject, thirdTestSubject });

if (firstResult != secondResult || firstResult != thirdResult)
if ((firstToSecond && secondToThird) != firstToThird)
{
throw new EqualityComparerImplementationException(string.Format(CultureInfo.CurrentCulture,
"The type '{0}' implements the `IEqualityComparer<T>` interface incorrectly: " +
Expand Down

0 comments on commit 8d41a0b

Please sign in to comment.