示例#1
0
        public void Peek_ValidData_ValidResult(IEnumerable <int> collection, int expected)
        {
            Task2.Queue <int> queue = new Task2.Queue <int>(collection);
            int actual = queue.Peek();

            Assert.AreEqual(expected, actual);
        }
示例#2
0
 public void Eneque_ValidData_validResult(int n, int[] array)
 {
     Task2.Queue <int> queue = new Task2.Queue <int>();
     for (int i = 0; i < n; i++)
     {
         queue.Enqueue(i);
     }
     CollectionAssert.AreEquivalent(array, queue);
 }
示例#3
0
 public void Peek_EmptyCollection_ThrowsException()
 {
     Task2.Queue <int> queue = new Task2.Queue <int>();
     Assert.Throws <InvalidOperationException>(() => queue.Peek());
 }
示例#4
0
 public void Dequeue_ValidData_ValidResult(int[] array, IEnumerable <int> collection)
 {
     Task2.Queue <int> queue = new Task2.Queue <int>(collection);
     queue.Dequeue();
     CollectionAssert.AreEquivalent(array, queue);
 }