You can find the complete code for unit testing mentioned in the blog in the project itself. The project follows a basic MVVM Architecture for simplicity. If you have not gone through the project, you should go through it and then come back. I will be using this project for the implementation part. Unit Testing ViewModel with Kotlin Flow and StateFlow - YOU ARE HERE.callbackFlow - Callback to Flow API in Kotlin.Instant Search Using Kotlin Flow Operators.Kotlin Flow Zip Operator for Parallel Multiple Network Calls.Long-running tasks in parallel with Kotlin Flow.Creating Flow Using Flow Builder in Kotlin. This blog is a part of the series I have written on Flow API in Kotlin: We will write the unit-test for the ViewModel which makes a network call and then, validate if our ViewModel is working as expected or not. In this blog, we are going to learn how to write the unit test for ViewModel with Kotlin Flow and StateFlow that follows a basic MVVM Architecture. I am Amit Shekhar, a mentor helping developers in getting high-paying tech jobs.īefore we start, I would like to mention that, I have released a video playlist to help you crack the Android Interview: Check out Android Interview Questions and Answers.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |