Example #1
0
        public void IsEmpty_OnStackWithItems_ReturnsFalse()
        {
            //Assemble
            int stackTestSize = 5;
            Stack target = new Stack(stackTestSize);

            //Act
            target.Push("A");

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

            //Assert
            Assert.AreEqual(expected, actual);
        }
Example #2
0
        public void IsEmpty_EmptyStackBlankString_ReturnsTrue()
        {
            //Near-arbitrary stack size for the creation of the stack:
            int stackTestSize = 5;
            Stack target = new Stack(stackTestSize);

            //Add item to stack
            target.Push("TestItem");
            //Pop from stack
            target.Pop();

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

            Assert.AreEqual(expected, actual);
        }
Example #3
0
        public void IsEmpty_EmptyStackNull_ReturnsTrue()
        {
            //Near-arbitrary stack size for the creation of the stack:
            int stackTestSize = 5;
            Stack target = new Stack(stackTestSize);

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

            Assert.AreEqual(expected, actual);
        }