[WIP] Add test case for repository.write().