Closed ninad458 closed 1 year ago
Found the problem. I was trying to access the viewModelScope in the init block. While the rule was switching the thread in starting
.
Both the solutions have the code smell. Would love to know if there is any better way to solve this.
Closing per the above comment, as I feel like this is more related to the specific use case rather than a general mockito-kotlin
question.
The above piece of code doesn't work. But the below one does.
I feel that the first one is much cleaner. Any reason why it's not working? I tried to find out why it's failing but no luck.
Some more information, which might be needed to debug further.
ViewModel class
viewModelScope extension variable