public void SubstitutesCompareDefaultForNull() { IEqualityComparer <int> source = null; var comparer = source.EquateSequence(); Assert.AreSame(EqualityCompare <int> .Default(), (comparer as SequenceEqualityComparer <int>).Source); }
public void SubstitutesCompareDefaultForNull() { IEqualityComparer <int> source = null; var comparer = source.EquateSequence(); Assert.Equal(EqualityComparerBuilder.For <int>().Default().EquateSequence().ToString(), comparer.ToString()); }
/// <summary> /// Returns an equality comparer that will perform a lexicographical equality on a sequence of items. /// This is the same as calling <see cref="EquateSequence{T}(System.Collections.Generic.IEqualityComparer{T}?,bool)"/> with <c>ignoreOrder</c> set to <c>false</c>. /// </summary> /// <typeparam name="T">The type of sequence elements being compared.</typeparam> /// <param name="source">The source comparer. If this is <c>null</c>, the default comparer is used.</param> /// <returns>A comparer that will perform a lexicographical equality on a sequence of items.</returns> public static IFullEqualityComparer <IEnumerable <T> > EquateSequence <T>(this IEqualityComparer <T>?source) => source.EquateSequence(ignoreOrder: false);