Added unit tests for Factories