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

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

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

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

            stack.Push("test");
            stack.Clear();
            stack.Pop();
        }
Esempio 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());
        }
Esempio n. 6
0
        public void CreateCannotPop()
        {
            var stack = new StackAsList <string>();

            stack.Pop();
        }