mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
* updated test cases to support db upgrade in #2476 * fixed errors
This commit is contained in:
parent
cd145efe91
commit
9c6e9bd017
1 changed files with 9 additions and 5 deletions
|
|
@ -108,15 +108,19 @@ class ContributionDaoTest {
|
||||||
@Test
|
@Test
|
||||||
fun migrateTableVersionFrom_v6_to_v7() {
|
fun migrateTableVersionFrom_v6_to_v7() {
|
||||||
Table.onUpdate(database, 6, 7)
|
Table.onUpdate(database, 6, 7)
|
||||||
// Table didn't change in version 7
|
// Table has changed in version 7
|
||||||
verifyZeroInteractions(database)
|
inOrder(database) {
|
||||||
|
verify<SQLiteDatabase>(database).execSQL(Table.ADD_WIKI_DATA_ENTITY_ID_FIELD)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun migrateTableVersionFrom_v7_to_v8() {
|
fun migrateTableVersionFrom_v7_to_v8() {
|
||||||
Table.onUpdate(database, 7, 8)
|
Table.onUpdate(database, 7, 8)
|
||||||
// Table didn't change in version 8
|
// Table has changed in version 8
|
||||||
verifyZeroInteractions(database)
|
inOrder(database) {
|
||||||
|
verify<SQLiteDatabase>(database).execSQL(Table.ADD_WIKI_DATA_ENTITY_ID_FIELD)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
@ -355,4 +359,4 @@ class ContributionDaoTest {
|
||||||
contribution.wikiDataEntityId = "Q1"
|
contribution.wikiDataEntityId = "Q1"
|
||||||
return contribution
|
return contribution
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue