/** To test if deleting the node following the current node */ @Test public void testDeleteNext() { // delete the node after the current node filledTest.deleteNext(filledTest.getFirstNode()); // the e should have been deleted assertEquals("tstString", filledTest.toString()); }
/** To test if inserting after a node works */ @Test public void testInsertAfter() { // insert a Z at the spot after the head filledTest.insertAfter(filledTest.getFirstNode(), "Z"); // insert a Z at the spot after the head twoTest.insertAfter(twoTest.getFirstNode(), "Z"); // insert a Z at the spot after the head oneTest.insertAfter(oneTest.getFirstNode(), "Z"); // the spot after the head should hold a "Z" assertEquals("Z", filledTest.getFirstNode().getNext().toString()); assertEquals("Z", twoTest.getFirstNode().getNext().toString()); assertEquals("Z", oneTest.getFirstNode().getNext().toString()); }