Example #1
0
        public void IsEmpty_OnStackWithTwoStrings_ReturnFalse()
        {
            Node testNode = new Node("Test");
            Node testNode2 = new Node("Test2");
            Stack testStack = new Stack();
            testStack.Push(testNode);
            testStack.Push(testNode2);
            bool expected = false;
            bool actual = testStack.IsEmpty();

            Assert.AreEqual(expected, actual);
        }
Example #2
0
        public void Peek_OnPopulatedStack_ReturnString()
        {
            Node testNode = new Node("test");
            Stack testStack = new Stack();
            testStack.Push(testNode);
            string expected = "test";
            string actual = testStack.Peek();

            Assert.AreEqual(expected, actual);
        }
Example #3
0
        public void IsEmpty_OnNewlyEmptyStack_ReturnTrue()
        {
            Node testNode = new Node("Test");
            Stack testStack = new Stack();
            testStack.Push(testNode);
            testStack.Pop();
            bool expected = true;
            bool actual = testStack.IsEmpty();

            Assert.AreEqual(expected, actual);
        }