public void TestInsertRangeWithExistingItems() { var list = new LargeList <Int32>(); var size = (1 << 16) + 2222; var oneThird = size / 3; for (int i = 0; i < oneThird; i++) { list.Add(i); } for (int i = 2 * oneThird; i < 3 * oneThird; i++) { list.Add(i); } var helperArray = new Int32[oneThird]; for (int i = oneThird; i < 2 * oneThird; i++) { helperArray[i - oneThird] = i; } list.InsertRange(oneThird, helperArray); for (int i = 0; i < 3 * oneThird; i++) { Assert.AreEqual(list[i], i); } }
public void TestInsertRangeInEmptyList() { var list = new LargeList <Int32>(); var size = (1 << 14) + 123; var helperArray = new Int32[size]; for (int i = 0; i < size; i++) { helperArray[i] = i; } list.InsertRange(0, helperArray); for (int i = 0; i < size; i++) { Assert.AreEqual(helperArray[i], list[i]); } }