Exemple #1
0
        public void IsEmpty_CalledOnNonEmptyStack_ReturnFalse()
        {
            Stack target = new Stack();
            //Push several items
            target.Push("a");
            target.Push("b");
            target.Push("c");
            target.Push("d");
            target.Push("e");
            target.Push("f");
            target.Push("g");

            Boolean expected = false;
            Boolean actual = target.IsEmpty();

            Assert.AreEqual(expected, actual);
        }
Exemple #2
0
        public void IsEmpty_PushSeveralAndPopAll_ReturnTrue()
        {
            Stack target = new Stack();
            //Push several items
            target.Push("a");
            target.Push("b");
            target.Push("c");
            target.Push("d");
            target.Push("e");
            target.Push("f");
            target.Push("g");

            //Pop all items
            target.Pop();
            target.Pop();
            target.Pop();
            target.Pop();
            target.Pop();
            target.Pop();
            target.Pop();

            Boolean expected = true;
            Boolean actual = target.IsEmpty();

            Assert.AreEqual(expected, actual);
        }
Exemple #3
0
        public void IsEmpty_CalledOnNewStack_ReturnTrue()
        {
            Stack target = new Stack();

            Boolean expected = true;
            Boolean actual = target.IsEmpty();

            Assert.AreEqual(expected, actual);
        }
Exemple #4
0
        public void IsEmpty_CalledOnStackWithOneItem_ReturnFalse()
        {
            Stack target = new Stack();

            target.Push("a");

            Boolean expected = false;
            Boolean actual = target.IsEmpty();

            Assert.AreEqual(expected, actual);
        }