public virtual void AddAll(PrimitiveLongArrayQueue otherQueue) { while (!otherQueue.Empty) { Enqueue(otherQueue.Dequeue()); } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void tailBeforeHeadCorrectIteration() internal virtual void TailBeforeHeadCorrectIteration() { PrimitiveLongArrayQueue queue = CreateQueue(); for (int i = 0; i < 14; i++) { queue.Enqueue(i); } for (int i = 0; i < 10; i++) { assertEquals(i, queue.Dequeue()); } for (int i = 14; i < 24; i++) { queue.Enqueue(i); } assertEquals(14, queue.Size()); LongIterator iterator = queue.LongIterator(); for (int j = 10; j < 24; j++) { assertTrue(iterator.hasNext()); assertEquals(j, iterator.next()); } assertFalse(iterator.hasNext()); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void addRemoveElementKeepQueueEmpty() internal virtual void AddRemoveElementKeepQueueEmpty() { PrimitiveLongArrayQueue longArrayQueue = CreateQueue(); for (int i = 0; i < 1000; i++) { longArrayQueue.Enqueue(i); assertEquals(i, longArrayQueue.Dequeue()); assertTrue(longArrayQueue.Empty); } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void tailBeforeHeadCorrectResize() internal virtual void TailBeforeHeadCorrectResize() { PrimitiveLongArrayQueue queue = CreateQueue(); for (int i = 0; i < 14; i++) { queue.Enqueue(i); } for (int i = 0; i < 10; i++) { assertEquals(i, queue.Dequeue()); } for (int i = 14; i < 34; i++) { queue.Enqueue(i); } assertEquals(24, queue.Size()); for (int j = 10; j < 34; j++) { assertEquals(j, queue.Dequeue()); } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void offerMoreThenQueueCapacityElements() internal virtual void OfferMoreThenQueueCapacityElements() { PrimitiveLongArrayQueue arrayQueue = CreateQueue(); for (int i = 1; i < 1234; i++) { arrayQueue.Enqueue(i); } int currentValue = 1; while (!arrayQueue.Empty) { assertEquals(currentValue++, arrayQueue.Dequeue()); } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void addAllElementsFromOtherQueue() internal virtual void AddAllElementsFromOtherQueue() { PrimitiveLongArrayQueue queue = CreateQueue(); queue.Enqueue(1); queue.Enqueue(2); PrimitiveLongArrayQueue otherQueue = CreateQueue(); otherQueue.Enqueue(3); otherQueue.Enqueue(4); queue.AddAll(otherQueue); assertTrue(otherQueue.Empty); assertEquals(0, otherQueue.Size()); assertEquals(4, queue.Size()); for (int value = 1; value <= 4; value++) { assertEquals(value, queue.Dequeue()); } assertTrue(queue.Empty); }