Extension for determining if two sequences are equal without creating a comparer

This commit is contained in:
Chris Cameron
2017-08-23 12:15:48 -04:00
parent 45623b3f99
commit cd9121592a
3 changed files with 79 additions and 2 deletions

View File

@@ -80,6 +80,16 @@ namespace ICD.Common.Utils.Tests.Extensions
Assert.AreEqual(true, exists);
}
[Test]
public void SequenceEqualTest()
{
int[] a = new int[] { 1, 2, 3, 4};
int[] b = new int[] { 1, 4, 9, 16};
Assert.IsFalse(a.SequenceEqual(b, (x, y) => x == y));
Assert.IsTrue(a.SequenceEqual(b, (x, y) => x * x == y));
}
[Test]
public void ScrambledEqualsTest()
{