Ejemplo n.º 1
0
        public void PushItemCanPopItem()
        {
            var stack = new StackAsList <string>();

            stack.Push("test");
            Assert.AreEqual("test", stack.Pop());
        }
Ejemplo n.º 2
0
        public void PushTwoItemsPopTopItem()
        {
            var stack = new StackAsList <string>();

            stack.Push("test");
            stack.Push("other test");
            Assert.AreEqual("other test", stack.Pop());
        }
Ejemplo n.º 3
0
        public void PushItemPopItemCountIs0()
        {
            var stack = new StackAsList <string>();

            stack.Push("test");
            stack.Pop();
            Assert.AreEqual(0, stack.Count);
        }
Ejemplo n.º 4
0
        public void ClearListCantPopItem()
        {
            var stack = new StackAsList <string>();

            stack.Push("test");
            stack.Clear();
            stack.Pop();
        }
Ejemplo n.º 5
0
        public void PushTwoItemsPopRemainsSecond()
        {
            var stack = new StackAsList <string>();

            stack.Push("test");
            stack.Push("other test");
            stack.Pop();
            Assert.AreEqual(1, stack.Count);
            Assert.AreEqual("test", stack.Peek());
        }
Ejemplo n.º 6
0
        public void CreateCannotPop()
        {
            var stack = new StackAsList <string>();

            stack.Pop();
        }