private void testIsEmpty(BasicQueue <DSInteger> the_queue) { //simple isEmpty() check with items and without Assert.AreEqual(false, the_queue.isEmpty()); the_queue.clear(); Assert.AreEqual(true, the_queue.isEmpty()); }
private void testClear(BasicQueue <DSInteger> the_queue) { //make sure there are items Assert.AreEqual(false, the_queue.isEmpty()); //make sure they are cleared the_queue.clear(); Assert.AreEqual(true, the_queue.isEmpty()); Assert.AreEqual(null, the_queue.dequeue()); }
private void testDequeue(BasicQueue <DSInteger> the_queue) { //make sure the elements are removed with a LIFO methodology Assert.AreEqual(100, the_queue.dequeue().value); Assert.AreEqual(50, the_queue.dequeue().value); Assert.AreEqual(200, the_queue.dequeue().value); Assert.AreEqual(25, the_queue.dequeue().value); Assert.AreEqual(400, the_queue.dequeue().value); //make sure no remain after all dequeues Assert.AreEqual(true, the_queue.isEmpty()); }