我使用 MockK 进行单元测试。我如何使用可为空和不可为空的参数来模拟私人通话?
我的方法:
private fun trySaveLogin(session: Session, login: String, passwordHash: String?, passwordHashNoSalt: String?, userInfo: UserInfo) { // doWork}
已经尝试过:
every { loginPresenter["trySaveLogin"](allAny<Any>()) } just Runs
every { loginPresenter["trySaveLogin"](any<String>(), any<String>(), any<String>(), any<String>(), any<UserInfo>()) } just Runs
一切都返回错误:
io.mockk.MockKException: can't find function trySaveLogin(-4d6de1423b10ebb8, ...) for dynamic call