【发布时间】:2018-08-22 19:05:05
【问题描述】:
我在用 Kotlin 创建的 Android 单元测试中看到这样的代码
`when`(context.getSharedPreferences(anyString(), anyInt())).thenReturn(sharedPreferences)
你能解释一下为什么when在里面吗?如果我删除 when 周围的 `` 我会看到 thenReturn 无法解决的问题。
【问题讨论】:
标签: unit-testing kotlin mockito