Ejemplo n.º 1
0
        public void count()
        {
            MyStack <string> stack = new MyStack <string>();

            stack.Push("1");
            stack.Push("2");
            stack.Push("3");
            stack.Push("4");
            stack.Push("5");
            stack.Push("6");
            stack.Push("7");
            stack.Push("8");
            stack.Push("9");
            int expected = 9;

            Assert.AreEqual(expected, stack.Count());
        }
Ejemplo n.º 2
0
        public void Pop_EmptyStack_ThrowsException()
        {
            var stack = new MyStack <int>();

            Assert.Throws <InvalidOperationException>(() => { stack.Pop(); });
        }
Ejemplo n.º 3
0
        public void isEmpty_EmptyStack_ReturnsTrue()
        {
            var stack = new MyStack <int>();

            Assert.IsTrue(stack.IsEmpty);
        }