#221 rework assertion that graph is empty

* move initial assertion to before method
* create test util method to increase readability
#221 use assertNodeExists in other test cases
#221 create util method for getting the number of nodes
#221 remove unused variable