public void TestExpandTo() { FasterList <int> list = new FasterList <int>(0); list.ExpandTo(10); Assert.That(list.capacity, Is.EqualTo(10)); Assert.That(list.count, Is.EqualTo(10)); }
void reserve(uint u) { if (u > capacity_) { dense.ExpandTo(u); sparse.ExpandTo(u); capacity_ = u; } }
public void TestSet() { FasterList <int> list = new FasterList <int>(0); list.ExpandTo(10); for (int i = 0; i < 10; i++) { list[i] = i; } for (int i = 0; i < 10; i++) { Assert.That(list[i], Is.EqualTo(i)); } }