Permalink
Browse files

Added test for dequeueing 200 times from a 4 item queue.

  • Loading branch information...
1 parent 40fecb3 commit 5a1760837299bed8c94270d2b9b93ecd60785ee7 @colabug committed Dec 12, 2011
Showing with 16 additions and 0 deletions.
  1. +16 −0 Java/Queue/test/com/colabug/queue/QueueTest.java
@@ -131,4 +131,20 @@ public void testDequeueFromArbitraryQueue()
assertEquals( data3, integerQueue.front() );
assertEquals( data4, integerQueue.back() );
}
+
+ @Test
+ public void testDequeueingManyMoreTimesThanItems()
+ {
+ // Populate queue
+ populateArbitraryQueue();
+
+ // Dequeue a lot
+ for ( int i = 0; i < 200; i++ )
+ {
+ integerQueue.dequeue();
+ }
+
+ // Verify empty
+ assertTrue( integerQueue.isEmpty() );
+ }
}

0 comments on commit 5a17608

Please sign in to comment.