Пример #1
0
        public static void Test()
        {
            QueueImplByStack q = new QueueImplByStack();

            for (int i = 0; i < 10; i++)
            {
                q.Enqueue(i);
            }
            Assert.AreEqual(10, q.Count());
            int[] dequeuedItem = new int[10];
            for (int i = 0; i < 10; i++)
            {
                dequeuedItem[i] = q.Dequeue();
            }
            Assert.AreEqual(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, dequeuedItem);
        }
Пример #2
0
 public static void Test()
 {
     QueueImplByStack q = new QueueImplByStack();
     for (int i = 0; i < 10; i++) q.Enqueue(i);
     Assert.AreEqual(10, q.Count());
     int[] dequeuedItem = new int[10];
     for (int i = 0; i < 10; i++)
     {
         dequeuedItem[i] = q.Dequeue();
     }
     Assert.AreEqual(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, dequeuedItem);
 }