Skip to content
0:00 / 0:00

#kotlincoroutines#android#unittesting

Testing Coroutines on Android (Android Dev Summit '19)

Android Developers

1.4M subscribers • 20 videos on Hallway

YouTube
  • Recommended by 1 person: 1 on Stack Overflow and its sister sites.
  • Presented by Manuel Vivo and Sean McQuillan
  • Made by the vendor. The company whose product it covers made or sponsored it.
  • May be out of date. Uploaded 7 years ago, in an area where tools change fast.

Intermediate. Assumes working knowledge.

46K views7 years ago1 recommendation

Mobile developmentTools and practiceAndroid and Jetpack ComposeTestingConcurrency and parallelism

Manuel Vivo and Sean McQuillan demonstrate how to effectively unit test asynchronous Kotlin coroutines on Android.

Coroutines simplify the way we do async programming on Android. However, testing async code has never been an easy task. In this talk, we show you how to master testing asynchronicity with coroutines to get that precious green check ✔️. Which questions do you have to ask yourself before writing a line of test code? How can you test coroutines that use Dispatchers.Main? What if you want to control the timing of your events? Why shouldn't you use Dispatchers.Unconfined? Come and learn how to test coroutines like a pro. Presented by: Manuel Vivo, Sean McQuillan Android Dev Summit '19 all sessions playlist → goo.gle/ADS19allsessions Subscribe to the Android Developers channel! → goo.gle/AndroidDevs Check out the photo album → goo.gle/ADS19Photos #AndroidDevSummit event: Android Dev Summit 2019; re_ty: Publish; product: Android - Languages; fullname: Manuel Vivo, Sean McQuillan;

Why it's here

1 person recommends this

What people say. Recommended as the essential guide for testing Kotlin coroutines and managing dispatchers in Android unit tests.

Long Rangeron Stack Overflow • Recommends

On “How to test livedata with coroutine in unit test”

…function for you to use the testCoroutine dispatcher in Java UnitTest . InstantExecutor Rule provide the function for you to monitor the livedata emit value in Java UnitTest . And be careful coroutine.dispatcher is the most important part for testing coroutine in Java UnitTest . It is suggested to watch the video about Coroutine testing in Kotlin link to this video Need to set the CoroutineDispatcher to be injected i……

u/psteigerin r/Kotlin • Mentions

On “Need Help Testing Callback Style Code with Coroutines”

…xception: This job has not completed yet` Which does not fix your problem, but gives you an idea of what's going on. In this configuration, the test finishes while coroutines are still running. I was not able to make your test pass. You might be interested in this issue: https://github.com/Kotlin/kotlinx.coroutines/issues/1204 And this video: [video Again, coroutines test environment has been far from perfect, unfortunately. But start to make yourself comfortable with the coroutine test environment as it has a lot of gotchas.…