Added test cases for factory class