From 09a5cd86954cff38a84f0fd36ea4f777a36edef5 Mon Sep 17 00:00:00 2001 From: Jaehwa Noh Date: Fri, 8 Mar 2024 12:53:46 +0900 Subject: [PATCH] Add code documentation. Change-Id: Idb9fe56112f3764a1d20ae7499b8e9be37674188 --- .../apps/nowinandroid/core/testing/util/MainDispatcherRule.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/testing/src/main/kotlin/com/google/samples/apps/nowinandroid/core/testing/util/MainDispatcherRule.kt b/core/testing/src/main/kotlin/com/google/samples/apps/nowinandroid/core/testing/util/MainDispatcherRule.kt index e0e2a2b0a..5d68f6e2a 100644 --- a/core/testing/src/main/kotlin/com/google/samples/apps/nowinandroid/core/testing/util/MainDispatcherRule.kt +++ b/core/testing/src/main/kotlin/com/google/samples/apps/nowinandroid/core/testing/util/MainDispatcherRule.kt @@ -30,6 +30,10 @@ import org.junit.runner.Description * for the duration of the test. */ class MainDispatcherRule( + /** + * Expose testDispatcher to share the scheduler to the test. + * See more in [Documentation](https://developer.android.com/kotlin/coroutines/test#injecting-test-dispatchers) + */ val testDispatcher: TestDispatcher = UnconfinedTestDispatcher(), ) : TestWatcher() { override fun starting(description: Description) = Dispatchers.setMain(testDispatcher)