I didn't get the point of the graph at the end of the video
@igorg.86244 жыл бұрын
Is there a google sample for this approach on Github?
@coonskinniggs3 жыл бұрын
There is a well written code-lab named Advanced Android Testing [5.1 to 5.3] which covers all the good testing stuff. FYI, I know it's a very late reply. :D
@daynyong2 жыл бұрын
Thanks for the great video. It seems that Deferred(result of coroutine async function) inherits Job which is cancellable. Has async implementation changed after this video or have I misunderstood 'suspend vs deferred' part?
@pedromoniz42244 жыл бұрын
Is there any resource for what that MainCoroutinerule actually is? There is little documentation and all these mechanisms require a bunch of prep, dunno why you jumped over it. Also, how does this mechanism affect live data? I also have a mechanism that allows me to run the work on IO and resolve the work in MAIN. So not only I have launch I also have async await. Any way to test this?
@seanmcquillan78344 жыл бұрын
Yep, it's not in a library (we didn't want to add any JUnit dependencies to kotlinx-coroutines-test), but this one by Rick Busarrow is a good place to start: gist.github.com/RBusarow/70256d782e2d789cfa167a0163b2e22e
@revm49424 жыл бұрын
@@seanmcquillan7834 Hi I have a question, on the example above the coroutine was launched with viewModelScope right and it uses Dispatchers.Main as default, what if I want to use Dispatchers.IO when inserting an entry in the Database, can I just wrap the suspend function body in the repository with `withContext(Dispatchers.IO)` and still test it with `runBlockingTest` right?
@RakhiDhavale4 жыл бұрын
Please mention the link to the repository where there are test cases for coroutines as per documentation