Refactor test classes for repositories
Currently there're 2 repositories - in-memory and database. Each has it's own test class where all the methods are same (with minor differences).
This task is to refactor these test classes:
- [ ] introduce a base class where all the tests methods will be living
- [ ] introduce an abstract method that returns a repository
- [ ] make tests method use the new abstract method
- [ ] make test classes only implement this abstract method
- use `tests-refactor` as a branch name