Table of Contents

Method AreCollectionsEqual

Namespace
Xunit.Sdk
Assembly
xunit.v3.assert.dll

AreCollectionsEqual(CollectionTracker?, CollectionTracker?, IEqualityComparer, bool, out int?)

Determine if two enumerable collections are equal. It contains logic that varies depending on the collection type (supporting arrays, dictionaries, sets, and generic enumerables).

public static bool AreCollectionsEqual(CollectionTracker? x, CollectionTracker? y, IEqualityComparer itemComparer, bool isDefaultItemComparer, out int? mismatchedIndex)

Parameters

x

First value to compare

y

Second value to comare

itemComparer IEqualityComparer

The comparer used for individual item comparisons

isDefaultItemComparer bool

Pass true if the itemComparer is the default item comparer from Xunit.Sdk.AssertEqualityComparer<T>; pass false, otherwise.

mismatchedIndex int?

The output mismatched item index when the collections are not equal

Returns

bool

Returns true if the collections are equal; false, otherwise.