Added test for factory