CleanCodeMVVMTesting
CleanCodeMVVMTesting copied to clipboard
Android Unit Testing Clean Code Architecture + MVVM
Clean Code Architecture + MVVM + UI / UT Testing
Source code of Medium Articles which describes Android Unit and Instrumentation Testing in Clean Code Architecture with MVVM.
- Medium Article Part One - Deep dive in Unit Testing
- Medium Article Part Two - Exciting Instrumentation Testing
Architecture followed
Main Libraries Used
-
Coroutines 🚀 https://developer.android.com/kotlin/coroutines
-
Retrofit 📲 https://square.github.io/retrofit/
-
MockWebServer 🎭 https://github.com/square/okhttp/tree/master/mockwebserver
-
Koin (💉Dependency Injection) https://insert-koin.io/
-
Kotlin 🥇 (https://developer.android.com/kotlin)
The article explains
- Ways to include dependencies using Koin
- Making usefull data flow using above architecture
- Creating unit test case with dependencies
- Override the default dependencies
- Mock required dependency and create required test cases
- Execute both Unit and Instrumentation test cases
For detailed explanation of points mentioned above, checkout Article published in Medium
Landing Screen with data from SWAPI API
Uses Swapi API for explaining required data flow
Uses https://swapi.co/ API as network end points.
The complete API documentation detail can be found over https://swapi.co/documentation