Beispiel #1
0
        public void PopTwoEntries()
        {
            var stack = new stackv2.Stack <int>();

            stack.Push(20);
            stack.Push(30);
            Assert.AreEqual(30, stack.Pop());
            Assert.AreEqual(20, stack.Pop());
        }
Beispiel #2
0
        public void PopAndCount()
        {
            var stack = new stackv2.Stack <int>();

            stack.Push(2);
            stack.Push(4);
            stack.Push(8);
            Assert.AreEqual(3, stack.Count());
            Assert.AreEqual(8, stack.Pop());
            Assert.AreEqual(2, stack.Count());
            Assert.AreEqual(4, stack.Pop());
            Assert.AreEqual(1, stack.Count());
        }
Beispiel #3
0
        public void PushUndPop()
        {
            var stack = new stackv2.Stack <string>();

            stack.Push("ab");
            var result = stack.Pop();

            Assert.AreEqual("ab", result);
        }