Added test for EntityFactory