got a working unit test for factory