forked from github/wulkanowy-mirror
Add build timestamp as build config field (#1567)
This commit is contained in:
parent
4e69cfe23c
commit
a240fd5d5f
6 changed files with 20 additions and 31 deletions
|
@ -16,7 +16,7 @@ abstract class AbstractMigrationTest {
|
|||
|
||||
val dbName = "migration-test"
|
||||
|
||||
val context: Context get() = ApplicationProvider.getApplicationContext<Context>()
|
||||
val context: Context get() = ApplicationProvider.getApplicationContext()
|
||||
|
||||
@get:Rule
|
||||
val helper: MigrationTestHelper = MigrationTestHelper(
|
||||
|
@ -33,7 +33,7 @@ abstract class AbstractMigrationTest {
|
|||
).addMigrations(
|
||||
*AppDatabase.getMigrations(
|
||||
SharedPrefProvider(PreferenceManager.getDefaultSharedPreferences(context)),
|
||||
AppInfo(context)
|
||||
AppInfo()
|
||||
)
|
||||
).build()
|
||||
// close the database and release any stream resources when the test finishes
|
||||
|
|
|
@ -29,15 +29,15 @@ class Migration35Test : AbstractMigrationTest() {
|
|||
close()
|
||||
}
|
||||
|
||||
helper.runMigrationsAndValidate(dbName, 35, true, Migration35(AppInfo(context)))
|
||||
helper.runMigrationsAndValidate(dbName, 35, true, Migration35(AppInfo()))
|
||||
|
||||
val db = getMigratedRoomDatabase()
|
||||
val students = runBlocking { db.studentDao.loadAll() }
|
||||
|
||||
assertEquals(2, students.size)
|
||||
|
||||
assertTrue { students[0].avatarColor in AppInfo(context).defaultColorsForAvatar }
|
||||
assertTrue { students[1].avatarColor in AppInfo(context).defaultColorsForAvatar }
|
||||
assertTrue { students[0].avatarColor in AppInfo().defaultColorsForAvatar }
|
||||
assertTrue { students[1].avatarColor in AppInfo().defaultColorsForAvatar }
|
||||
}
|
||||
|
||||
private fun createStudent(db: SupportSQLiteDatabase, id: Long) {
|
||||
|
|
|
@ -37,7 +37,7 @@ class StudentTest {
|
|||
studentDb = studentDb,
|
||||
semesterDb = semesterDb,
|
||||
sdk = mockSdk,
|
||||
appInfo = AppInfo(mockk()),
|
||||
appInfo = AppInfo(),
|
||||
appDatabase = mockk()
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue