Guest User

Untitled

a guest
Feb 20th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. AppDatabase appDatabase = (AppDatabase) MigrationUtil.getDatabaseAfterPerformingMigrations(migrationTestHelper, AppDatabase.class, TEST_DB_NAME,
  2. MIGRATION_1_2, MIGRATION_2_3);
  3.  
  4. //Now checking if the new database contains the correctly exported data from the previous database
  5. NotesDao migratedDataNotesDao = appDatabase.notesDao();
  6. assertEquals(LiveDataTestUtil.getValue(migratedDataNotesDao.getNoteById(noteList.get(3).getNotesId())).getNoteDesc(),
  7. noteList.get(3).getNoteDesc());
  8. assertNull(LiveDataTestUtil.getValue(migratedDataNotesDao.getNoteById(noteList.get(3).getNotesId())).getSubTitle());
  9. appDatabase.close();
Add Comment
Please, Sign In to add comment