public bool Queue_Contains_CorrectResult(int[] array) { var queue = new QueueSolution.Queue <double>(); for (int i = 0; i < array.Length; i++) { queue.Add(array[i]); } return(queue.Contains(3)); }
public void Queue_UncorrectVersion_InvalidOperationException() { var queue = new QueueSolution.Queue <int>() { 1, 2, 3 }; foreach (var item in queue) { queue.Add(5); } }
public object[] Queue_Clear_CorrectResult(object[] array) { var queue = new QueueSolution.Queue <object>(); for (int i = 0; i < array.Length; i++) { queue.Add(array[i]); } queue.Clear(); return(queue.ToArray()); }
public double[] Queue_Dequeue_CorrectResult(double[] array) { var queue = new QueueSolution.Queue <double>(); for (int i = 0; i < array.Length; i++) { queue.Add(array[i]); } queue.Dequeue(); return(queue.ToArray()); }
public int[] Queue_Add_CorrectResult(int[] array) { var queue = new QueueSolution.Queue <int>(); for (int i = 0; i < array.Length; i++) { queue.Add(array[i]); } queue.Add(10); return(queue.ToArray()); }
public void Queue_AddNull_ArgumentNullException() { var queue = new QueueSolution.Queue <object>(); Assert.Throws <ArgumentNullException>(() => queue.Add(null)); }
public void Queue_DequeueEmpty_InvalidOperationException() { var queue = new QueueSolution.Queue <int>(); Assert.Throws <InvalidOperationException>(() => queue.Dequeue()); }