/// <inheritdoc/> public virtual void SequenceEqual <T>(IEnumerable <T> expected, IEnumerable <T> actual, IEqualityComparer <T>?equalityComparer = null, string?message = null) { var comparer = new SequenceEqualEnumerableEqualityComparer <T>(equalityComparer); var areEqual = comparer.Equals(expected, actual); if (!areEqual) { throw new InvalidOperationException(CreateMessage(message ?? $"Sequences are not equal")); } }
public void SequenceEqual <T>(IEnumerable <T> expected, IEnumerable <T> actual, IEqualityComparer <T> equalityComparer = null, string message = null) { var comparer = new SequenceEqualEnumerableEqualityComparer <T>(equalityComparer); var areEqual = comparer.Equals(expected, actual); if (!areEqual) { Assert.Fail(message); } }
public void SequenceEqual <T>(IEnumerable <T> expected, IEnumerable <T> actual, IEqualityComparer <T> equalityComparer = null, string message = null) { if (message is null) { if (equalityComparer is null) { Assert.Equal(expected, actual); } else { Assert.Equal(expected, actual, equalityComparer); } } else { var comparer = new SequenceEqualEnumerableEqualityComparer <T>(equalityComparer); var areEqual = comparer.Equals(expected, actual); if (!areEqual) { Assert.True(false, message); } } }