public void IteratorTest() { var arr = UnsafeStack.Allocate <int>(10); for (int i = 0; i < 10; i++) { UnsafeStack.Push(arr, i); } Assert.AreEqual(10, UnsafeStack.GetCount(arr)); int num = 9; foreach (int i in UnsafeStack.GetEnumerator <int>(arr)) { Assert.AreEqual(num--, i); } UnsafeStack.Free(arr); }