public void ForeachReverseListTest() { var master = new QuickList <int>(5); master.Push(0); master.Push(1); master.Push(2); master.Push(3); master.Push(4); master.Push(5); master.Push(6); master.Push(7); master.Push(8); master.Push(9); master.ReverseForeach(); var i = 0; foreach (var v in master) { Assert.AreEqual(9 - i++, v); break; } i = 0; foreach (var v in master) { Assert.AreEqual(9 - i++, v); } }
public void EmptyListForeach() { var master = new QuickList <int>(5); foreach (var v in master) { Assert.Fail(); } master.ReverseForeach(); foreach (var v in master) { Assert.Fail(); } }