Ejemplo n.º 1
0
        public void EnumeratingOnFixedStack()
        {
            var stack = new ResizingArrayStack <int>(1);

            stack.Push(10);
            stack.Push(15);
            stack.Push(20);
            stack.Push(30);
            stack.Push(40);

            var arr = stack.ToArray(); // because this uses the Enumerator

            Assert.AreEqual(new int[] { 40, 30, 20, 15, 10 }, arr);
        }