Add tests for NodeFactory