示例#1
0
        public void PopWithResize()
        {
            IntStack stack = new IntStack(1);

            stack.Push(1);
            stack.Push(2);
            stack.Push(3);
            Assert.AreEqual(stack.Pop(), 3);
            Assert.AreEqual(stack.Pop(), 2);
            Assert.AreEqual(stack.Pop(), 1);
        }
示例#2
0
        public void NonEmpty()
        {
            IntStack stack = new IntStack(4);

            Assert.IsTrue(stack.IsEmpty);
            stack.Push(1);
            Assert.IsFalse(stack.IsEmpty);
            stack.Pop();
            Assert.IsTrue(stack.IsEmpty);
        }