diff options
Diffstat (limited to 'sample')
5 files changed, 35 insertions, 6 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 bfdcfff..cc45b4e 100644 --- a/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/KPrefViewTest.kt +++ b/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/KPrefViewTest.kt @@ -29,6 +29,7 @@ import androidx.test.rule.ActivityTestRule import ca.allanwang.kau.sample.test.BaseTest import dagger.hilt.android.testing.HiltAndroidTest import dagger.hilt.android.testing.UninstallModules +import javax.inject.Inject import kotlin.test.assertFalse import kotlin.test.assertTrue import org.hamcrest.BaseMatcher @@ -41,7 +42,6 @@ import org.junit.Test import org.junit.rules.RuleChain import org.junit.rules.TestRule import org.junit.runner.RunWith -import javax.inject.Inject /** * Created by Allan Wang on 21/12/2018. diff --git a/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/SampleTestApp.kt b/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/SampleTestApp.kt index da53ce1..89e74c7 100644 --- a/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/SampleTestApp.kt +++ b/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/SampleTestApp.kt @@ -27,7 +27,6 @@ import dagger.hilt.android.testing.HiltTestApplication import org.junit.rules.TestRule import org.junit.runner.Description import org.junit.runners.model.Statement -import java.lang.RuntimeException class SampleTestRunner : AndroidJUnitRunner() { override fun newApplication( diff --git a/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/test/BaseTest.kt b/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/test/BaseTest.kt index c3a17ea..1cba88f 100644 --- a/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/test/BaseTest.kt +++ b/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/test/BaseTest.kt @@ -1,8 +1,23 @@ +/* + * Copyright 2020 Allan Wang + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package ca.allanwang.kau.sample.test import dagger.hilt.android.testing.HiltAndroidRule -import org.junit.Rule import kotlin.test.BeforeTest +import org.junit.Rule abstract class BaseTest { @Suppress("LeakingThis") @@ -14,4 +29,4 @@ abstract class BaseTest { fun before() { hiltRule.inject() } -}
\ No newline at end of file +} diff --git a/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/test/TestModules.kt b/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/test/TestModules.kt index 4e49810..74da014 100644 --- a/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/test/TestModules.kt +++ b/sample/src/androidTest/kotlin/ca/allanwang/kau/sample/test/TestModules.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2020 Allan Wang + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package ca.allanwang.kau.sample.test import ca.allanwang.kau.kpref.KPrefFactory @@ -12,4 +27,4 @@ import dagger.hilt.android.components.ApplicationComponent object PrefFactoryTestModule { @Provides fun factory(): KPrefFactory = KPrefFactoryInMemory -}
\ No newline at end of file +} diff --git a/sample/src/main/kotlin/ca/allanwang/kau/sample/KPrefSample.kt b/sample/src/main/kotlin/ca/allanwang/kau/sample/KPrefSample.kt index a12c433..ee39184 100644 --- a/sample/src/main/kotlin/ca/allanwang/kau/sample/KPrefSample.kt +++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/KPrefSample.kt @@ -55,4 +55,4 @@ object PrefModule { object PrefFactoryModule { @Provides fun factory(@ApplicationContext context: Context): KPrefFactory = KPrefFactoryAndroid(context) -}
\ No newline at end of file +} |