コード例 #1
0
        public void noEstaVacioCuandoContieneElementos()
        {
            Stack stack = new Stack();
            stack.Push(1);

            bool isEmpty = stack.IsEmpty;

            Assert.IsFalse(isEmpty);
        }
コード例 #2
0
        public void Test()
        {
            Stack stack = new Stack();
            Assert.IsTrue(stack.IsEmpty); //Test behaviour N°1

            stack.Push(1);
            Assert.IsFalse(stack.IsEmpty); //Test behaviour N°2

            Assert.AreEqual(1, stack.Pop()); //Test behaviour N°3
        }