예제 #1
0
 public void CheckEnqueue()
 {
     CustomQueueWithArray<int> queue = new CustomQueueWithArray<int>(10);
     queue.EnQueue(2);
     int length = queue.Length;
     int element = queue.Peek();
     Assert.AreEqual(length, 1);
     Assert.AreEqual(2, element);
 }
예제 #2
0
 public void CheckPeek()
 {
     CustomQueueWithArray<double> queue = new CustomQueueWithArray<double>(10);
     queue.EnQueue(3.14);
     queue.EnQueue(6.78);
     double element = queue.Peek();
     Assert.AreEqual(3.14, element);
     Assert.AreEqual(2, queue.Length);
 }