mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-15 04:35:00 +00:00
Extension method for padding a sequence
This commit is contained in:
@@ -267,6 +267,23 @@ namespace ICD.Common.Utils.Tests.Extensions
|
||||
Assert.AreEqual(6, values[5]);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void PadRightTest()
|
||||
{
|
||||
int[] items = new[] {1, 2, 3}.PadRight(5).ToArray();
|
||||
|
||||
Assert.AreEqual(5, items.Length);
|
||||
Assert.AreEqual(1, items[0]);
|
||||
Assert.AreEqual(2, items[1]);
|
||||
Assert.AreEqual(3, items[2]);
|
||||
Assert.AreEqual(0, items[3]);
|
||||
Assert.AreEqual(0, items[4]);
|
||||
|
||||
items = items.PadRight(2).ToArray();
|
||||
|
||||
Assert.AreEqual(5, items.Length);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void OrderTest()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user