Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AppDatabase appDatabase = (AppDatabase) MigrationUtil.getDatabaseAfterPerformingMigrations(migrationTestHelper, AppDatabase.class, TEST_DB_NAME,
- MIGRATION_1_2, MIGRATION_2_3);
- //Now checking if the new database contains the correctly exported data from the previous database
- NotesDao migratedDataNotesDao = appDatabase.notesDao();
- assertEquals(LiveDataTestUtil.getValue(migratedDataNotesDao.getNoteById(noteList.get(3).getNotesId())).getNoteDesc(),
- noteList.get(3).getNoteDesc());
- assertNull(LiveDataTestUtil.getValue(migratedDataNotesDao.getNoteById(noteList.get(3).getNotesId())).getSubTitle());
- appDatabase.close();
Add Comment
Please, Sign In to add comment