Add tests for RepositoryFactory