Added some unit tests for database.