aboutsummaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2019-06-13 22:53:35 -0700
committerAllan Wang <me@allanwang.ca>2019-06-13 22:53:35 -0700
commit05403e185adcd5ae9829027fb53a134dec6b7d97 (patch)
tree9503b7f36324dd6075ad8e4caf6a9cd02b6897dd /app/src
parent246ac8944f9c98eed921e8a120e852882a134021 (diff)
downloadfrost-05403e185adcd5ae9829027fb53a134dec6b7d97.tar.gz
frost-05403e185adcd5ae9829027fb53a134dec6b7d97.tar.bz2
frost-05403e185adcd5ae9829027fb53a134dec6b7d97.zip
Fix test code errors
Diffstat (limited to 'app/src')
-rw-r--r--app/src/androidTest/kotlin/com/pitchedapps/frost/db/DatabaseTest.kt7
-rw-r--r--app/src/androidTest/kotlin/com/pitchedapps/frost/db/GenericDbTest.kt2
2 files changed, 4 insertions, 5 deletions
diff --git a/app/src/androidTest/kotlin/com/pitchedapps/frost/db/DatabaseTest.kt b/app/src/androidTest/kotlin/com/pitchedapps/frost/db/DatabaseTest.kt
index c79d212e..49d18b31 100644
--- a/app/src/androidTest/kotlin/com/pitchedapps/frost/db/DatabaseTest.kt
+++ b/app/src/androidTest/kotlin/com/pitchedapps/frost/db/DatabaseTest.kt
@@ -18,8 +18,7 @@ package com.pitchedapps.frost.db
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.runner.RunWith
-import org.koin.error.NoBeanDefFoundException
-import org.koin.standalone.get
+import org.koin.core.error.NoBeanDefFoundException
import org.koin.test.KoinTest
import kotlin.reflect.KClass
import kotlin.reflect.full.functions
@@ -33,7 +32,7 @@ class DatabaseTest : KoinTest {
fun <T : Any> hasKoin(klazz: KClass<T>): Boolean =
try {
- get<T>(clazz = klazz)
+ getKoin().get<T>(klazz, qualifier = null, parameters = null)
true
} catch (e: NoBeanDefFoundException) {
false
@@ -48,7 +47,7 @@ class DatabaseTest : KoinTest {
val members = FrostDatabase::class.java.kotlin.functions.filter { it.name.endsWith("Dao") }
.mapNotNull { it.returnType.classifier as? KClass<*> }
assertTrue(members.isNotEmpty(), "Failed to find dao interfaces")
- val missingKoins = (members + FrostDatabase::class).filter { !hasKoin(it) }
+ val missingKoins = members.filter { !hasKoin(it) }
assertTrue(missingKoins.isEmpty(), "Missing koins: $missingKoins")
}
}
diff --git a/app/src/androidTest/kotlin/com/pitchedapps/frost/db/GenericDbTest.kt b/app/src/androidTest/kotlin/com/pitchedapps/frost/db/GenericDbTest.kt
index add9f509..18415e33 100644
--- a/app/src/androidTest/kotlin/com/pitchedapps/frost/db/GenericDbTest.kt
+++ b/app/src/androidTest/kotlin/com/pitchedapps/frost/db/GenericDbTest.kt
@@ -51,7 +51,7 @@ class GenericDbTest : BaseDbTest() {
@Test
fun ignoreErrors() {
runBlocking {
- dao.save(GenericEntity(GenericDao.TYPE_TABS, "${FbItem.ACTIVITY_LOG.name},unknown,${FbItem.EVENTS.name}"))
+ dao._save(GenericEntity(GenericDao.TYPE_TABS, "${FbItem.ACTIVITY_LOG.name},unknown,${FbItem.EVENTS.name}"))
assertEquals(
listOf(FbItem.ACTIVITY_LOG, FbItem.EVENTS),
dao.getTabs(),