unit test for repository