Adam Hurwitz
1 min readAug 14, 2019

--

Carlos Daniel, I’m wondering what the difference is between runBlocking and the MainCoroutineRule strategy. Both are outlined in the Android Testing Codelab, Unit Testing with Coroutines section.

Also, both appear to make the method run synchronously, whereas the MainCoroutineRule pauses and resumes the coroutine to control the flow.

Perhaps withrunBlocking the code runs synchronously by default, whereas with MainCoroutineRule, it runs synchronously with manual control. 🤔

--

--

Adam Hurwitz

An account about nothing | Researcher and product consultant