Test cases for Android application components
Closed this issue · 11 comments
- Add Unit tests for modules
data
,repository
,app
etc. - Add some integrations tests for Android.
- We can use libraries like Kotest, Mockk, etc for testing which are completely Kotlin libraries.
Hi @PatilShreyas, I have been exploring tests on Flow and Coroutines and would like to contribute. Is there already any WIP for this?
@Varsha-Kulkarni As such there's no WIP. I'll let you know once it's planned. Thank you so much for showing interest in contributing 😃
@PatilShreyas Sure, Thanks. I was wondering, if I start writing tests and raise PR, will that be fine?
Hi, @PatilShreyas need a helping hand in this?
@ch8n once I'm done with initial setup. Can contribute to it
@ch8n @Varsha-Kulkarni If you are interested can now contribute to tests of NotyKT. I've set up a new branch tests
for unit tests.
See some tests I added for your reference:
Cool I will be looking into em soon.
It would be great if we can plan how write code covering various features of the app.
UT till repository layer would be generic but ui one could be better to write it per flow. What's your opinion @PatilShreyas ?
Yeah, that would be great to have UI tests as well. Also, I'm planning ViewModel Unit tests as well.
Also, added a sample for VM tests: https://github.com/PatilShreyas/NotyKT/blob/tests/noty-android/app/src/test/java/dev/shreyaspatil/noty/view/viewmodel/NotesViewModelTest.kt
Also, added a sample for VM tests: https://github.com/PatilShreyas/NotyKT/blob/tests/noty-android/app/src/test/java/dev/shreyaspatil/noty/view/viewmodel/NotesViewModelTest.kt
This is great. I will definitely start on this soon.
Added unit test cases in the PR #392