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. 🤔

--

--

--

Open Sourcer

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Adam Hurwitz

Adam Hurwitz

Open Sourcer

More from Medium

Excerpt of CC’s Journal

How to Turn on and Use Screen Saver on Windows 11?

Do you feel like your ship is off course?