I am new to testing in general and trying to figure out an acceptable strategy for testing the Sqlite database that I'm using on Android.
I'm struggling with how exactly I should do this and the merits of different methods.
Without much experience it seems like a good method might be to run an integration test. AFAIK this would mean spinning up an emulator to test on and then running tests that would actually create and modify a database on the emulator. This method sounds attractive because I would be able to do a 'round trip' test where I would start with some preconstructed data objects and could test all of the CRUD operations using them and a real db. This would allow me to actually verify that if I inserted an object and then read it back out, that the POJO that went in is the same that came out. I could also verify things such as ordering of a collection of objects, confirm that deletions really took place, database upgrades, etc...
A different method of testing that I could envision would involve using unit tests instead of integration tests. I could envision these tests involving verifying that a ContentValues object was created correctly or ensuring that given a certain Cursor object that a POJO was created correctly.
To me it seems like the integration test method is superior because it would provide good test coverage that the CRUD code that I've written is correct so that I won't run into situations where I expected a field of an object to be populated but it was null, or something like that.
What do other people do to test their Sqlite code on Android?
Can anyone help me understand the merits of unit tests vs. integration tests when it comes to Sqlite on Android?