mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-15 12:45:01 +00:00
Extension for determining if two sequences are equal without creating a comparer
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user