I've wrote several unit tests for already existing DatabaseOpenHelper
class. I covered creation scenario and migration from old schema to new one. Unfortunately I don't fill that my tests are good. For example for DB creation I check that SQLiteDatabase. execSQL()
was called three times (we have so far three tables now) and check that query string is in set of specified SQL strings.
The issue so far - if someone changes order of columns the test will fail. Probably this is OK.
But what is your way of SQL schema unit testing? Or you don't have unit tests for that and relay only on the integration one?