Пример #1
0
        public void PushItemCanPopItem()
        {
            var stack = new StackAsList <string>();

            stack.Push("test");
            Assert.AreEqual("test", stack.Pop());
        }
Пример #2
0
        public void PushTwoItemsPopTopItem()
        {
            var stack = new StackAsList <string>();

            stack.Push("test");
            stack.Push("other test");
            Assert.AreEqual("other test", stack.Pop());
        }
Пример #3
0
        public void PushItemPopItemCountIs0()
        {
            var stack = new StackAsList <string>();

            stack.Push("test");
            stack.Pop();
            Assert.AreEqual(0, stack.Count);
        }
Пример #4
0
        public void ClearListCantPopItem()
        {
            var stack = new StackAsList <string>();

            stack.Push("test");
            stack.Clear();
            stack.Pop();
        }
Пример #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());
        }
Пример #6
0
        public void CreateCannotPop()
        {
            var stack = new StackAsList <string>();

            stack.Pop();
        }