예제 #1
0
        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));
        }
예제 #2
0
        public void Queue_UncorrectVersion_InvalidOperationException()
        {
            var queue = new QueueSolution.Queue <int>()
            {
                1, 2, 3
            };

            foreach (var item in queue)
            {
                queue.Add(5);
            }
        }
예제 #3
0
        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());
        }
예제 #4
0
        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());
        }
예제 #5
0
        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());
        }
예제 #6
0
        public void Queue_AddNull_ArgumentNullException()
        {
            var queue = new QueueSolution.Queue <object>();

            Assert.Throws <ArgumentNullException>(() => queue.Add(null));
        }
예제 #7
0
        public void Queue_DequeueEmpty_InvalidOperationException()
        {
            var queue = new QueueSolution.Queue <int>();

            Assert.Throws <InvalidOperationException>(() => queue.Dequeue());
        }