I am new in JUnit testing on Android and I'm testing a function, which is using android context object to get a string resources and making some comparsions. How can I mock android context object to successfully test this function? For testing I'm using Mockk testing library.
private val context = mockk<Context>()
private val contextWrapper = ApplicationContextWrapper(context)
private val objectUnderTest = AppLinkService(contextWrapper)
我试图用mockk<Context>()
模拟上下文,但我得到了以下例外
io.mockk.MockKException: no answer found for: Context(#1).getApplicationContext()