Ejemplo n.º 1
0
        public void Dequeue()
        {
            const int value = 10;

            FixedCapacityQueue<int> items = new FixedCapacityQueue<int>(10);
            items.Enqueue(value);
            int i = items.Dequeue();
            Assert.AreEqual(value, i, "Dequeued value did not match expected value");
            Assert.AreEqual(0, items.Count, "Count did not meet expected value");
        }
Ejemplo n.º 2
0
        public void Dequeue()
        {
            const int value = 10;

            FixedCapacityQueue <int> items = new FixedCapacityQueue <int>(10);

            items.Enqueue(value);
            int i = items.Dequeue();

            Assert.AreEqual(value, i, "Dequeued value did not match expected value");
            Assert.AreEqual(0, items.Count, "Count did not meet expected value");
        }
Ejemplo n.º 3
0
 public void DequeueMany()
 {
     FixedCapacityQueue<int> items = new FixedCapacityQueue<int>(10);
     for (int i = 0; i < 10; i++)
     {
         items.Enqueue(i);
     }
     for (int i = 0; i < 10; i++)
     {
         Assert.AreEqual(i, items.Dequeue(), "Dequeued value did not match expected value");
         Assert.AreEqual(9 - i, items.Count, "Count did not meet expected value");
     }
 }
Ejemplo n.º 4
0
        public void DequeueMany()
        {
            FixedCapacityQueue <int> items = new FixedCapacityQueue <int>(10);

            for (int i = 0; i < 10; i++)
            {
                items.Enqueue(i);
            }
            for (int i = 0; i < 10; i++)
            {
                Assert.AreEqual(i, items.Dequeue(), "Dequeued value did not match expected value");
                Assert.AreEqual(9 - i, items.Count, "Count did not meet expected value");
            }
        }