Table of Contents

Class AssertEquivalenceComparer<T>

Namespace
Xunit
Assembly
xunit.v3.assert.dll

An implementation of IEqualityComparer<T> that uses the same logic from Equivalent(object?, object?, bool).

public class AssertEquivalenceComparer<T> : IEqualityComparer<T>

Type Parameters

T

The item type being compared

Inheritance
AssertEquivalenceComparer<T>
Implements
Inherited Members

Remarks

A generic version of this is provided so that it can be used with Equal<T>(IEnumerable<T>?, IEnumerable<T>?, IEqualityComparer<T>) to ensure strict ordering of collections while doing equivalence comparisons for the items inside the collection, per https://github.com/xunit/xunit/discussions/3186.

Constructors

AssertEquivalenceComparer(bool)

Initializes a new instance of the AssertEquivalenceComparer<T> class.

Methods

Equals(T?, T?)
GetHashCode(T)