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); }
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); }
public void Peek_EmptyCollection_ThrowsException() { Task2.Queue <int> queue = new Task2.Queue <int>(); Assert.Throws <InvalidOperationException>(() => queue.Peek()); }
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); }