Exemple #1
0
        public void Peek_nonString_ReturnException()
        {
            Stack testStack = new Stack();

            testStack.Peek();
        }
Exemple #2
0
        public void Peek_PushItemx_Returnsx()
        {
            Stack testStack = new Stack();

            testStack.Push("Bob");
            testStack.Push("Fred");

            string expected = "Fred";

            string actual = testStack.Peek();

            Assert.AreEqual(expected, actual);
        }
Exemple #3
0
        public void Peek_PushManyItems_ReturnLastItemPushed()
        {
            Stack testStack = new Stack();
            testStack.Push("Fred");
            testStack.Push("Max");
            testStack.Push("Jim");
            testStack.Push("Tom");

            string expected = "Tom";

            string actual = testStack.Peek();

            Assert.AreEqual(expected, actual);
        }