Beispiel #1
0
        public void EnqueueItemTestSuccess()
        {
            var q = new CQueue(10);

            q.Enqueue(13);
            Assert.AreEqual(1, q.Size);
        }
Beispiel #2
0
        public void DequeueMultipleItemsTestFail()
        {
            var q = new CQueue(10);

            q.Enqueue(13);
            Assert.AreEqual(1, q.Size);

            q.Dequeue();
            q.Dequeue();
        }
Beispiel #3
0
        public void EnqueueMultipleOperationsTestSuccess()
        {
            var q = new CQueue(10);

            q.Enqueue(13);
            Assert.AreEqual(1, q.Size);
            q.Enqueue(13);
            Assert.AreEqual(2, q.Size);
            q.Enqueue(19);
            Assert.AreEqual(3, q.Size);
            q.Dequeue();
            Assert.AreEqual(2, q.Size);
            q.Dequeue();
            Assert.AreEqual(1, q.Size);
        }
Beispiel #4
0
        public void QueueFullFail()
        {
            var q = new CQueue(3);

            q.Enqueue(13);
            Assert.AreEqual(1, q.Size);
            q.Enqueue(13);
            Assert.AreEqual(2, q.Size);
            q.Enqueue(19);
            Assert.AreEqual(3, q.Size);
            q.Enqueue(20);
        }
Beispiel #5
0
        public void EnqueuZeroQueueItemTestFail()
        {
            var q = new CQueue(0);

            q.Enqueue(10);
        }
Beispiel #6
0
        public void DequeueEmptyQueueItemTestFail()
        {
            var q = new CQueue(10);

            q.Dequeue();
        }