add tests for EntityFactory