• Home
  • Raw
  • Download

Lines Matching refs:TestCoroutineDispatcher

190 to pause the [TestCoroutineDispatcher] that [runBlockingTest] uses.
236 …| [TestCoroutineDispatcher] | A [CoroutineDispatcher] which can be used for tests and integrates w…
239 …tested, it may be easier to provide a [TestCoroutineDispatcher]. For example [Dispatchers.setMain]…
240 a [TestCoroutineDispatcher] but not a [TestCoroutineScope].
242 [TestCoroutineScope] will always use a [TestCoroutineDispatcher] to execute coroutines. It
309 *Note:* [TestCoroutineScope], [TestCoroutineDispatcher], and [TestCoroutineExceptionHandler] are in…
313 ### Providing an explicit `TestCoroutineDispatcher`
316 many situations where it is easier to provide a [TestCoroutineDispatcher]. For example [Dispatchers…
317 does not accept a [TestCoroutineScope] and requires a [TestCoroutineDispatcher] to control coroutin…
320 The main difference between `TestCoroutineScope` and `TestCoroutineDispatcher` is how uncaught exce…
321 When using `TestCoroutineDispatcher` uncaught exceptions thrown in coroutines will use regular
323 `TestCoroutineScope` will always use `TestCoroutineDispatcher` as it's dispatcher.
325 A test can use a `TestCoroutineDispatcher` without declaring an explicit `TestCoroutineScope`. This…
329 Since [TestCoroutineDispatcher] is stateful in order to keep track of executing coroutines, it is
334 private val testDispatcher = TestCoroutineDispatcher()
350 // TestCoroutineDispatcher.runBlockingTest uses `testDispatcher` to run coroutines
366 ### Using `TestCoroutineScope` and `TestCoroutineDispatcher` without `runBlockingTest`
368 It is supported to use both [TestCoroutineScope] and [TestCoroutineDispatcher] without using the [r…
394 Both dispatchers are not designed to interact with `TestCoroutineDispatcher`.
396 Tests should provide a `TestCoroutineDispatcher` to replace these dispatchers if the `withContext` …
397 … For example, a test that calls `veryExpensiveOne` should provide a `TestCoroutineDispatcher` using
408 dispatcher. The function `veryExpensiveTwo` will behave identically in a `TestCoroutineDispatcher` …
410 directly, there is no need to inject a `TestCoroutineDispatcher` into this function.
418 Tests should provide a `TestCoroutineDispatcher` to code that calls `withContext` to provide time c…
451 [TestCoroutineDispatcher]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-test/kotl…