softengsquad / studentmap

0 stars 0 forks source link

Sof 49/feature/testdatabase #20

Closed lewisclark closed 4 months ago

JohanKool3 commented 4 months ago

The tests present only expect functional outcomes. Is it possible to add some tests that can make sure that there is correct error handling for database calls (e.g. database not reachable, bad data read)

lewisclark commented 4 months ago

The tests present only expect functional outcomes. Is it possible to add some tests that can make sure that there is correct error handling for database calls (e.g. database not reachable, bad data read)

I'm not sure how we can test the reachability of the database because the library will create the database if it does not already exist, and because the database is stored locally, a connection to the database shouldn't fail.

The unit tests currently present will catch errors originating from a bad read from the buildings table. For example if the table does not exist, there is an error in the query or a type conversion from the database couldn't be made