Exemple #1
0
        public void PushAndPeekTest()
        {
            var stackMulti = new StackMulti(5);

            // Push
            for (int i = 0; i < 15; i++)
            {
                stackMulti.Push(i);
            }

            //Peek
            Assert.Equal(14, stackMulti.Peek());
        }
Exemple #2
0
        public void PopAtTest()
        {
            var stackMulti = new StackMulti(5);

            // Push
            for (int i = 0; i < 25; i++)
            {
                stackMulti.Push(i);
            }

            Assert.Equal(4, stackMulti.PopAt(0));
            Assert.Equal(9, stackMulti.PopAt(1));
            Assert.Equal(14, stackMulti.PopAt(2));
        }
Exemple #3
0
        public void PushAndPopTest()
        {
            var stackMulti = new StackMulti(5);

            // Push and Pop
            for (int i = 0; i < 50; i++)
            {
                stackMulti.Push(i);           //Push

                if (i % 4 == 0 || i % 6 == 0) // Pop
                {
                    int val = stackMulti.Pop();
                    Assert.Equal(i, val);
                }
            }
        }