-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a22457d
commit 512705c
Showing
17 changed files
with
376 additions
and
355 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
app/src/main/java/de/tum/informatics/www1/artemis/native_app/android/app_module.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package de.tum.informatics.www1.artemis.native_app.android | ||
|
||
import de.tum.informatics.www1.artemis.native_app.android.db.dbModule | ||
import de.tum.informatics.www1.artemis.native_app.core.data.dataModule | ||
import de.tum.informatics.www1.artemis.native_app.core.datastore.datastoreModule | ||
import de.tum.informatics.www1.artemis.native_app.core.device.deviceModule | ||
import de.tum.informatics.www1.artemis.native_app.core.ui.uiModule | ||
import de.tum.informatics.www1.artemis.native_app.core.websocket.websocketModule | ||
import de.tum.informatics.www1.artemis.native_app.feature.courseregistration.courseRegistrationModule | ||
import de.tum.informatics.www1.artemis.native_app.feature.courseview.courseViewModule | ||
import de.tum.informatics.www1.artemis.native_app.feature.dashboard.dashboardModule | ||
import de.tum.informatics.www1.artemis.native_app.feature.exerciseview.exerciseModule | ||
import de.tum.informatics.www1.artemis.native_app.feature.lectureview.lectureModule | ||
import de.tum.informatics.www1.artemis.native_app.feature.login.loginModule | ||
import de.tum.informatics.www1.artemis.native_app.feature.metis.communicationModule | ||
import de.tum.informatics.www1.artemis.native_app.feature.push.pushModule | ||
import de.tum.informatics.www1.artemis.native_app.feature.quiz.quizParticipationModule | ||
import de.tum.informatics.www1.artemis.native_app.feature.settings.settingsModule | ||
import org.koin.dsl.module | ||
|
||
val appModule = module { includes( | ||
dataModule, | ||
uiModule, | ||
datastoreModule, | ||
deviceModule, | ||
websocketModule, | ||
courseRegistrationModule, | ||
courseViewModule, | ||
dashboardModule, | ||
loginModule, | ||
exerciseModule, | ||
communicationModule, | ||
quizParticipationModule, | ||
settingsModule, | ||
lectureModule, | ||
pushModule, | ||
dbModule | ||
)} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
...otlin/de/tum/informatics/www1/artemis/native_app/feature/coremodulestest/AppModuleTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package de.tum.informatics.www1.artemis.native_app.feature.coremodulestest | ||
|
||
import android.app.Application | ||
import android.content.Context | ||
import androidx.lifecycle.SavedStateHandle | ||
import androidx.work.WorkerParameters | ||
import de.tum.informatics.www1.artemis.native_app.android.appModule | ||
import de.tum.informatics.www1.artemis.native_app.core.common.CurrentActivityListener | ||
import de.tum.informatics.www1.artemis.native_app.core.common.test.UnitTest | ||
import de.tum.informatics.www1.artemis.native_app.feature.metis.shared.content.StandalonePostId | ||
import de.tum.informatics.www1.artemis.native_app.feature.quiz.QuizType | ||
import org.junit.Test | ||
import org.junit.experimental.categories.Category | ||
import org.junit.runner.RunWith | ||
import org.koin.core.annotation.KoinExperimentalAPI | ||
import org.koin.test.verify.verify | ||
import org.robolectric.RobolectricTestRunner | ||
import kotlin.coroutines.CoroutineContext | ||
|
||
@OptIn(KoinExperimentalAPI::class) | ||
@Category(UnitTest::class) | ||
@RunWith(RobolectricTestRunner::class) | ||
class AppModuleTest { | ||
|
||
@Test | ||
fun checkKoinModule() { | ||
|
||
// Verify Koin configuration | ||
appModule.verify( | ||
extraTypes = listOf( | ||
CoroutineContext::class, | ||
SavedStateHandle::class, | ||
Boolean::class, | ||
Long::class, | ||
StandalonePostId::class, | ||
Application::class, | ||
CurrentActivityListener::class, | ||
Context::class, | ||
WorkerParameters::class, | ||
QuizType.WorkableQuizType::class, | ||
QuizType.ViewableQuizType::class, | ||
) | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
45 changes: 45 additions & 0 deletions
45
...n/de/tum/informatics/www1/artemis/native_app/feature/exercise_view/exercise_moduleTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package de.tum.informatics.www1.artemis.native_app.feature.exercise_view | ||
|
||
import de.tum.informatics.www1.artemis.native_app.core.common.test.UnitTest | ||
import de.tum.informatics.www1.artemis.native_app.core.data.service.network.CourseExerciseService | ||
import de.tum.informatics.www1.artemis.native_app.core.data.service.network.ExerciseService | ||
import de.tum.informatics.www1.artemis.native_app.core.datastore.AccountService | ||
import de.tum.informatics.www1.artemis.native_app.core.datastore.ServerConfigurationService | ||
import de.tum.informatics.www1.artemis.native_app.core.device.NetworkStatusProvider | ||
import de.tum.informatics.www1.artemis.native_app.core.websocket.LiveParticipationService | ||
import de.tum.informatics.www1.artemis.native_app.feature.exerciseview.ExerciseViewModel | ||
import de.tum.informatics.www1.artemis.native_app.feature.exerciseview.exerciseModule | ||
import de.tum.informatics.www1.artemis.native_app.feature.exerciseview.participate.textexercise.TextExerciseParticipationViewModel | ||
import org.junit.Test | ||
import org.junit.experimental.categories.Category | ||
import org.junit.runner.RunWith | ||
import org.koin.core.annotation.KoinExperimentalAPI | ||
import org.koin.test.verify.definition | ||
import org.koin.test.verify.verify | ||
import org.robolectric.RobolectricTestRunner | ||
import kotlin.coroutines.CoroutineContext | ||
|
||
@RunWith(RobolectricTestRunner::class) | ||
@Category(UnitTest::class) | ||
internal class exercise_moduleTest { | ||
|
||
@OptIn(KoinExperimentalAPI::class) | ||
@Test | ||
fun checkKoinModule() { | ||
exerciseModule.verify( | ||
injections = listOf( | ||
definition<ExerciseViewModel>(Long::class), | ||
definition<TextExerciseParticipationViewModel>(Long::class, Long::class) | ||
), | ||
extraTypes = listOf( | ||
ServerConfigurationService::class, | ||
NetworkStatusProvider::class, | ||
AccountService::class, | ||
CoroutineContext::class, | ||
ExerciseService::class, | ||
LiveParticipationService::class, | ||
CourseExerciseService::class | ||
) | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.