예제 #1
0
 public void PeekEmptyStack_ReturnsException()
 {
     Stack stack = new Stack();
     stack.Peek();
 }
예제 #2
0
        public void PushPeek_RetainsPeekValue()
        {
            Stack stack = new Stack();

            String pushed = "one";
            stack.Push(pushed);
            stack.Peek();
            bool expectedBool = false;

            bool actualBool = stack.IsEmpty();

            Assert.AreEqual(expectedBool, actualBool, "Peeked value not on top of stack");
        }
예제 #3
0
        public void PushPeek_ReturnsPushValue()
        {
            Stack stack = new Stack();

            String pushed = "one";
            stack.Push(pushed);
            String peeked = stack.Peek();

            Assert.AreEqual(pushed, peeked, "Pushed value does not equal peeked value");
        }