I'm trying to test my SQLite Database but I seem to be a little bit lost between all the different contexts.
my test class extends AndroidTestCase
here is my code :
//Context context = new Activity();
//IsolatedContext context = getMockContext();
//Context context = new MockContext();
//Context context = getInstrumentation().getContext();
Context context = getContext();
helper = new MySQLiteHelper(context);
assertNotNull(helper);
SQLiteDatabase db = helper.getWritableDatabase();
assertNotNull(db); <---- it fails here !
as you can see I tried with many different contexts that i saw people use and work with. I really don't understand why it doesn't work in my case.
Aucun commentaire:
Enregistrer un commentaire