Context context = mock(Context.class);
If you want to get the context with Kotlin
and Mockito
, you can do it in the following way:
mock(Context::class.java)
Let's have a look at the following class: MockContext
If you need more insight, check the Official Testing Fundamentals page
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With