Пример #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);
 }