<PackageReference Include="NUnit" Version="4.1.0" />

DictionaryEntriesComparer

Comparator for two DictionaryEntrys.
using System.Collections; using System.Runtime.CompilerServices; namespace NUnit.Framework.Constraints.Comparers { internal static class DictionaryEntriesComparer { [System.Runtime.CompilerServices.NullableContext(1)] public static EqualMethodResult Equal(object x, object y, ref Tolerance tolerance, ComparisonState state, NUnitEqualityComparer equalityComparer) { if (x is DictionaryEntry) { DictionaryEntry dictionaryEntry = (DictionaryEntry)x; if (y is DictionaryEntry) { DictionaryEntry dictionaryEntry2 = (DictionaryEntry)y; ComparisonState state2 = state.PushComparison(x, y); Tolerance tolerance2 = Tolerance.Exact; EqualMethodResult equalMethodResult = equalityComparer.AreEqual(dictionaryEntry.Key, dictionaryEntry2.Key, ref tolerance2, state2); if (equalMethodResult == EqualMethodResult.ComparedEqual) equalMethodResult = equalityComparer.AreEqual(dictionaryEntry.Value, dictionaryEntry2.Value, ref tolerance, state2); return equalMethodResult; } } return EqualMethodResult.TypesNotSupported; } } }