예제 #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);
 }