I'm trying to write unit tests for our app and I'm a little bit confused about testing our DAO layer. This layer uses a lot of methods of real SQLiteDatabase
and we don't think that using Mockito
in this case is a proper way. So, our question is - how to test DAO layer with real database? Is it real in Android to get real instance of database inside unit tests?
What we want to test:
- execution of SQL statements, for example
database.execSQL(..)
methods. - execution of
insert
,update
,delete
,rawQuery
methods ofSQLiteDatabase
class.
Thanks in advance!
Aucun commentaire:
Enregistrer un commentaire