test: close DB in TimelineDaoTest (#512)
The previous code forgot to close the DB after TimelineDaoTest was run, so a warning message was displayed when the test was run locally. Close the database using the `@After` annotation. Fixes #511
This commit is contained in:
parent
21b85fce1b
commit
0105a8179c
|
@ -28,6 +28,7 @@ import dagger.hilt.android.testing.HiltAndroidRule
|
||||||
import dagger.hilt.android.testing.HiltAndroidTest
|
import dagger.hilt.android.testing.HiltAndroidTest
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
import kotlinx.coroutines.runBlocking
|
import kotlinx.coroutines.runBlocking
|
||||||
|
import org.junit.After
|
||||||
import org.junit.Assert.assertEquals
|
import org.junit.Assert.assertEquals
|
||||||
import org.junit.Before
|
import org.junit.Before
|
||||||
import org.junit.Rule
|
import org.junit.Rule
|
||||||
|
@ -51,6 +52,11 @@ class TimelineDaoTest {
|
||||||
hilt.inject()
|
hilt.inject()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@After
|
||||||
|
fun tearDown() {
|
||||||
|
db.close()
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun insertGetStatus() = runBlocking {
|
fun insertGetStatus() = runBlocking {
|
||||||
val setOne = makeStatus(statusId = 3)
|
val setOne = makeStatus(statusId = 3)
|
||||||
|
|
Loading…
Reference in New Issue