Add unit tests for graph conversion