Example #1
0
        public void QueueCanCorrectlyReturnFirstPushedItems(QueueFacade <int> queue)
        {
            for (int i = 0; i < 100; i++)
            {
                queue.Enqueue(i);
            }

            for (int i = 0; i < 100; i++)
            {
                var element = queue.Dequeue();
                Assert.AreEqual(i, element);
            }
        }
Example #2
0
        public void QueueCanCorrectlyEnquedAlongWithDequeing(QueueFacade <int> queue)
        {
            for (int i = 0; i < 100; i++)
            {
                queue.Enqueue(i);
            }

            for (int i = 0; i < 30; i++)
            {
                var element = queue.Dequeue();
                Assert.AreEqual(i, element);
            }

            for (int i = 100; i < 200; i++)
            {
                queue.Enqueue(i);
            }

            for (int i = 30; i < 200; i++)
            {
                var element = queue.Dequeue();
                Assert.AreEqual(i, element);
            }
        }