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

            stack.Push(1);
            stack.Push(2);

            Assert.AreEqual(2, stack.Peek());
        }
Ejemplo n.º 2
0
        public void Peek_PushTwoItemsAndPop_ReturnsHeadElement()
        {
            var stack = new MyStack <int>();

            stack.Push(1);
            stack.Push(2);

            stack.Pop();

            Assert.AreEqual(1, stack.Peek());
        }