Test Case Method Identifier
getNodeIterator
Test Items
The purpose of testing the getNodeIterator method is to check whether the method correctly handles the iterator of the nodes of a graph.
Input Specification
To test the getNodeIterator method, we used several behaviors on the iterator element returned by the method, both illegal. One is to get the next node from the iterator, reaching a point where there are no nodes left in the iterator, and try to get a next node which doesn't exists, while the second one is to remove nodes from the iterator, again reaching a point where the are no more nodes to be removed, but still try to remove another node.
Output Specification
Assert that, in the first case, the method iterator.next() returns a NoSuchElementException, while in the second one, the method iterator.remove() should return an IllegalStateException.