Ejemplo n.º 1
0
        public void TestPeek()
        {
            PopulateTestQueue();

            int currentValue = 2;
            int queueCount   = SampleSize;

            do
            {
                Assert.Equal(currentValue, TestQueue.Peek());
                Assert.Equal(queueCount, TestQueue.Count);

                Assert.Equal(TestQueue.Peek(), TestQueue.Dequeue());
                queueCount--;

                Assert.Equal(queueCount, TestQueue.Count);
                currentValue++;
            } while (TestQueue.Count > 0);
        }