mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 03:57:32 +00:00
Extension for determining if two sequences are equal without creating a comparer
This commit is contained in:
parent
45623b3f99
commit
cd9121592a
3 changed files with 79 additions and 2 deletions
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue