Exemplo n.º 1
0
 public void TestStackAddElements()
 {
     Stack testStack = new Stack();
     testStack.Push(10);
     testStack.Push(10);
     testStack.Push(10);
     testStack.Push(10);
     Assert.AreEqual(4, testStack.Size(), "The size is not calculated correctly");
 }
Exemplo n.º 2
0
        public void TestStackResize()
        {
            Stack testStack = new Stack();
            int numberOfAddedElements = 12;

            for (int i = 0; i < numberOfAddedElements; i++)
            {
                testStack.Push(10);
            }

            Assert.AreEqual(numberOfAddedElements, testStack.Size(), "The size is not calculated correctly");
        }
Exemplo n.º 3
0
 public void TestStackSizeNoElements()
 {
     Stack testStack = new Stack();
     Assert.AreEqual(0, testStack.Size(), "The size is not calculated correctly");
 }