コード例 #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");
 }
コード例 #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");
        }
コード例 #3
0
 public void TestStackSizeNoElements()
 {
     Stack testStack = new Stack();
     Assert.AreEqual(0, testStack.Size(), "The size is not calculated correctly");
 }