Example #1
0
        public void Stack_Count_EmptyStack_ReturnCount()
        {
            Stack stack = new Stack();

            int expected = 0;
            int actual = stack.Count();

            Assert.AreEqual(expected, actual);
        }
Example #2
0
        public void Stack_PushLargeAmountCount_ReturnCount()
        {
            Stack stack = new Stack();
            for (int i = 0; i < 10000000; i++)
            {
                stack.Push("Testing");
            }

            int expected = 10000000;
            int actual = stack.Count();

            Assert.AreEqual(expected, actual);
        }
Example #3
0
        public void Stack_PushCount_ReturnCount()
        {
            Stack stack = new Stack();
            stack.Push("Testing1");
            stack.Push("Testing2");
            stack.Push("Testing3");
            stack.Push("Testing4");
            stack.Push("Testing5");

            int expected = 5;
            int actual = stack.Count();

            Assert.AreEqual(expected, actual);
        }
Example #4
0
        public void Stack_PushPopCount_EmptyStack_ReturnCount()
        {
            Stack stack = new Stack();
            stack.Push("Testing1");
            stack.Push("Testing2");

            stack.Pop();

            int expected = 1;
            int actual = stack.Count();

            Assert.AreEqual(expected, actual);
        }