Merge pull request #46 from fknives/issue#39-fix-with-activityscenario-close
Issue#39 Fix most test's running time via using close on ActivityScenario.
This commit is contained in:
commit
96e2f492c9
4 changed files with 6 additions and 8 deletions
|
|
@ -29,7 +29,7 @@ object SetupAuthenticationState : KoinTest {
|
|||
|
||||
mainDispatcherTestRule.advanceUntilIdleOrActivityIsDestroyed()
|
||||
|
||||
activityScenario.moveToState(Lifecycle.State.DESTROYED)
|
||||
activityScenario.close()
|
||||
}
|
||||
|
||||
fun setupLogout(
|
||||
|
|
@ -43,6 +43,6 @@ object SetupAuthenticationState : KoinTest {
|
|||
|
||||
mainDispatcherTestRule.advanceUntilIdleOrActivityIsDestroyed()
|
||||
|
||||
activityScenario.moveToState(Lifecycle.State.DESTROYED)
|
||||
activityScenario.close()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package org.fnives.test.showcase.ui.home
|
||||
|
||||
import androidx.arch.core.executor.testing.InstantTaskExecutorRule
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import androidx.test.core.app.ActivityScenario
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
import org.fnives.test.showcase.model.content.FavouriteContent
|
||||
|
|
@ -73,7 +72,7 @@ class MainActivityTest : KoinTest {
|
|||
|
||||
@After
|
||||
fun tearDown() {
|
||||
activityScenario.moveToState(Lifecycle.State.DESTROYED)
|
||||
activityScenario.close()
|
||||
disposable.dispose()
|
||||
}
|
||||
|
||||
|
|
@ -130,7 +129,7 @@ class MainActivityTest : KoinTest {
|
|||
|
||||
val expectedItem = FavouriteContent(ContentData.contentSuccess.first(), true)
|
||||
|
||||
activityScenario.moveToState(Lifecycle.State.DESTROYED)
|
||||
activityScenario.close()
|
||||
activityScenario = ActivityScenario.launch(MainActivity::class.java)
|
||||
mainDispatcherTestRule.advanceUntilIdleWithIdlingResources()
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package org.fnives.test.showcase.ui.login
|
||||
|
||||
import androidx.arch.core.executor.testing.InstantTaskExecutorRule
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import androidx.test.core.app.ActivityScenario
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
import org.fnives.test.showcase.R
|
||||
|
|
@ -63,7 +62,7 @@ class AuthActivityTest : KoinTest {
|
|||
|
||||
@After
|
||||
fun tearDown() {
|
||||
activityScenario.moveToState(Lifecycle.State.DESTROYED)
|
||||
activityScenario.close()
|
||||
disposable.dispose()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class SplashActivityTest : KoinTest {
|
|||
|
||||
@After
|
||||
fun tearDown() {
|
||||
activityScenario.moveToState(Lifecycle.State.DESTROYED)
|
||||
activityScenario.close()
|
||||
disposable.dispose()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue