From dfa5cd7ceff685ed03a3b01e41eb2d1e29c61fb0 Mon Sep 17 00:00:00 2001 From: Sharon Akinyi <79141719+sharon2719@users.noreply.github.com> Date: Fri, 29 Sep 2023 05:20:43 +0300 Subject: [PATCH] Add oncreate test for QuestApplication (#2785) --- .../fhircore/quest/QuestApplicationTest.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/android/quest/src/test/java/org/smartregister/fhircore/quest/QuestApplicationTest.kt b/android/quest/src/test/java/org/smartregister/fhircore/quest/QuestApplicationTest.kt index 5c78e19af8..fa3253f597 100644 --- a/android/quest/src/test/java/org/smartregister/fhircore/quest/QuestApplicationTest.kt +++ b/android/quest/src/test/java/org/smartregister/fhircore/quest/QuestApplicationTest.kt @@ -16,6 +16,7 @@ package org.smartregister.fhircore.quest +import android.content.Intent import dagger.hilt.android.testing.HiltAndroidRule import dagger.hilt.android.testing.HiltAndroidTest import io.mockk.every @@ -30,6 +31,7 @@ import org.junit.Before import org.junit.Rule import org.junit.Test import org.smartregister.fhircore.quest.robolectric.RobolectricTest +import org.smartregister.fhircore.quest.ui.appsetting.AppSettingActivity @HiltAndroidTest class QuestApplicationTest : RobolectricTest() { @@ -91,4 +93,13 @@ class QuestApplicationTest : RobolectricTest() { Assert.assertNotNull(config) } + + @Test + fun testOnCreate() { + hiltRule.inject() + application.onCreate() + + val intent = Intent(application, AppSettingActivity::class.java) + application.startActivity(intent) + } }