aboutsummaryrefslogtreecommitdiff
path: root/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/KPrefViewTest.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2020-06-21 22:13:56 -0700
committerAllan Wang <me@allanwang.ca>2020-06-21 22:13:56 -0700
commitcd24bc8175938ff289c48a6ec3bb956cc22fb79e (patch)
tree742e4385983c02dcca48534c665fd73738dbd277 /sample/src/androidTest/kotlin/ca/allanwang/kau/sample/KPrefViewTest.kt
parent69b2d504934eab4e69b7ef9a574c6c7560cee54b (diff)
downloadkau-cd24bc8175938ff289c48a6ec3bb956cc22fb79e.tar.gz
kau-cd24bc8175938ff289c48a6ec3bb956cc22fb79e.tar.bz2
kau-cd24bc8175938ff289c48a6ec3bb956cc22fb79e.zip
Update deps and add base test class
Diffstat (limited to 'sample/src/androidTest/kotlin/ca/allanwang/kau/sample/KPrefViewTest.kt')
-rw-r--r--sample/src/androidTest/kotlin/ca/allanwang/kau/sample/KPrefViewTest.kt15
1 files changed, 2 insertions, 13 deletions
diff --git a/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/KPrefViewTest.kt b/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/KPrefViewTest.kt
index 91c98e7..a8475b3 100644
--- a/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/KPrefViewTest.kt
+++ b/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/KPrefViewTest.kt
@@ -25,13 +25,9 @@ import androidx.test.espresso.matcher.BoundedMatcher
import androidx.test.espresso.matcher.ViewMatchers.withChild
import androidx.test.espresso.matcher.ViewMatchers.withText
import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.MediumTest
import androidx.test.rule.ActivityTestRule
-import dagger.hilt.android.testing.HiltAndroidRule
import dagger.hilt.android.testing.HiltAndroidTest
-import dagger.hilt.android.testing.HiltTestApplication
import dagger.hilt.android.testing.UninstallModules
-import kotlin.test.BeforeTest
import kotlin.test.assertFalse
import kotlin.test.assertTrue
import org.hamcrest.BaseMatcher
@@ -54,22 +50,15 @@ import javax.inject.Inject
@RunWith(AndroidJUnit4::class)
@HiltAndroidTest
@UninstallModules(PrefFactoryModule::class)
-class KPrefViewTest {
+class KPrefViewTest : BaseTest() {
val activity: ActivityTestRule<MainActivity> = ActivityTestRule(MainActivity::class.java)
- val hiltRule = HiltAndroidRule(this)
-
@get:Rule
- val rule: TestRule = RuleChain.outerRule(hiltRule).around(SampleTestRule()).around(activity)
+ val rule: TestRule = RuleChain.outerRule(SampleTestRule()).around(activity)
@Inject lateinit var pref: KPrefSample
- @BeforeTest
- fun before() {
- hiltRule.inject()
- }
-
fun verifyCheck(checked: Boolean): Matcher<View> {
return object : BoundedMatcher<View, View>(View::class.java) {