Example #1
0
        public void TestClear()
        {
            MySimpleStack S = new MySimpleStack(5);

            S.Push(1);
            S.Push(2);
            S.Push(3);
            S.Clear();
            Assert.AreEqual(0, S.Count());
        }
Example #2
0
        public void TestPush()
        {
            //Push 3 items, check Count
            MySimpleStack S = new MySimpleStack(5);

            S.Push(1);
            S.Push(2);
            S.Push(3);
            Assert.AreEqual(3, S.Count());
        }
Example #3
0
        public void TestMethodPush()
        {
            MySimpleStack S = new MySimpleStack(5);

            S.Push(5);
            Assert.AreEqual(1, S.Count);
            S.Push(2);
            S.Push(5);
            Assert.AreEqual(2, S.Count);
        }
Example #4
0
        public void TestPop()
        {
            //Push some items, check the poped value
            MySimpleStack S = new MySimpleStack(5);

            S.Push(1);
            S.Push(2);
            S.Push(3);
            Assert.AreEqual(3, S.Pop());
            Assert.AreEqual(2, S.Pop());
        }
Example #5
0
        public void TestPeek()
        {
            //Push some items, check Peeked value and Count
            MySimpleStack S = new MySimpleStack(5);

            S.Push(1);
            S.Push(2);
            S.Push(3);
            S.Peek();
            Assert.AreEqual(3, S.Peek());
            Assert.AreEqual(3, S.Count());
        }