예제 #1
0
        public void IsEmptyTestOnEmptyStack()
        {
            Stack testStack = new Stack();

            bool expected = true;

            bool actual = testStack.IsEmpty();

            Assert.AreEqual(expected, actual);
        }
예제 #2
0
        public void IsEmptyTestOnPreviouslyPopulatedStackNowEmpty()
        {
            Stack testStack = new Stack();
            StringNode testString1 = new StringNode();
            StringNode testString2 = new StringNode();
            testString1.Value = "Test String 1";
            testString2.Value = "Test String 2";

            bool expected = true;

            testStack.Push(testString1);
            testStack.Push(testString2);
            testStack.Pop();
            testStack.Pop();

            bool actual = testStack.IsEmpty();

            Assert.AreEqual(expected, actual);
        }
예제 #3
0
        public void IsEmptyTestOnStackWithItems()
        {
            Stack testStack = new Stack();
            StringNode testString1 = new StringNode();
            StringNode testString2 = new StringNode();
            testString1.Value = "Test String 1";
            testString2.Value = "Test String 2";

            bool expected = false;

            testStack.Push(testString1);
            testStack.Push(testString2);

            bool actual = testStack.IsEmpty();

            Assert.AreEqual(expected, actual);
        }