Add tests to DB implementation