Beispiel #1
0
        public void IsEmpty_NewStack_ReturnsTrue()
        {
            Stack testStack = new Stack();

            bool expected = true;

            bool actual = testStack.IsEmpty();

            Assert.AreEqual(expected, actual);
        }
Beispiel #2
0
        public void IsEmpty_FullStack_ReturnsFalse()
        {
            Stack testStack = new Stack();

            testStack.Push("Bob");
            testStack.Push("Fred");

            bool expected = false;

            bool actual = testStack.IsEmpty();

            Assert.AreEqual(expected, actual);
        }
Beispiel #3
0
        public void IsEmpty_DeleteTest_ReturnTrue()
        {
            Stack testStack = new Stack();
            testStack.Push("Fred");
            testStack.Push("Max");
            testStack.Push("Jim");
            testStack.Push("Tom");
            testStack.Pop();
            testStack.Pop();
            testStack.Pop();
            testStack.Pop();

            bool expected = true;

            bool actual = testStack.IsEmpty();

            Assert.AreEqual(expected, actual);
        }