I have a class DBHandler which takes a query, runs it through the SQL server, checks for errors and returns the result. How can I unit test this class?
DBHandler
A quick solution for a mock db works like this:
Setup an HSQLDB test server independent from your app.
Populate with test data.
Use conditional code where you connect to your real database, to connect to the test server. A property in your application can control this.
Test the application