mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 03:57:32 +00:00
Optimized ToList and ToArray extension methods
This commit is contained in:
parent
ca2c0fb38f
commit
30afd0391d
2 changed files with 61 additions and 0 deletions
|
|
@ -288,6 +288,24 @@ namespace ICD.Common.Utils.Tests.Extensions
|
|||
Assert.AreEqual(3, values[1]);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ToArrayCountTest()
|
||||
{
|
||||
int[] array = Enumerable.Range(0, 100).ToArray();
|
||||
int[] copy = array.ToArray(array.Length);
|
||||
|
||||
Assert.IsTrue(copy.SequenceEqual(array));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ToListCountTest()
|
||||
{
|
||||
List<int> array = Enumerable.Range(0, 100).ToList();
|
||||
List<int> copy = array.ToList(array.Count);
|
||||
|
||||
Assert.IsTrue(copy.SequenceEqual(array));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ToHashSetTest()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue