add unit tests for database