I'm trying to start unit testing on my application (should have done so from the beginning). I've got an Eclipse project structure set up and everything seems to work well, but...
I'm subclassing SQLiteOpenHelper
to access the application database. This works well for the application, but when using the same class in the unit tests, it writes to the same database as the actual application. This is obviously rather irritating, since unit test data shows up when developing and testing the actual application.
What's the best way to make the SQLiteOpenHelper
class write to a different database file when being called from the unit tests?