Exemple #1
0
        public void Peek_PushSevenPeekAndCount_ReturnSeven()
        {
            Stack target = new Stack();

            target.Push("a");
            target.Push("b");
            target.Push("c");
            target.Push("d");
            target.Push("e");
            target.Push("f");
            target.Push("h");

            target.Peek();

            int expected = 7;
            int actual = target.Count();

            Assert.AreEqual(expected, actual);
        }
Exemple #2
0
        public void Push_OneItemOnNewStackCallPeek_ReturnItem()
        {
            Stack target = new Stack();
            String testItem = "MyApplesAreBad";

            target.Push(testItem);

            String expected = testItem;
            String actual = target.Peek();

            Assert.AreEqual(expected, actual);
        }
Exemple #3
0
        public void Peek_CalledOnNewStack_ReturnException()
        {
            Stack target = new Stack();

            target.Peek();

            Assert.Fail();
        }