public void TestPeek() { FasterList <int> list = new FasterList <int>(); for (int i = 0; i < 10; i++) { list.Push(i); } Assert.That(list.Peek(), Is.EqualTo(9)); Assert.That(list.capacity, Is.EqualTo(10)); Assert.That(list.count, Is.EqualTo(10)); }
public void TestPop() { FasterList <int> list = new FasterList <int>(); for (int i = 0; i < 10; i++) { list.Push(i); } for (int i = 9; i >= 0; i--) { Assert.That(list.Pop(), Is.EqualTo(i)); } Assert.That(list.capacity, Is.EqualTo(10)); Assert.That(list.count, Is.EqualTo(0)); }