https://kotlinlang.org logo
#test
Title
# test
v

vkholyavin

12/11/2018, 9:23 AM
Hello! How mock functional argument?
Copy code
val myFunction = mock<(String) -> Unit>()
// actions
verify(myFunction).invoke(captor.capture())
throws: java.lang.IllegalStateException: captor.capture() must not be null
Mockito Kotlin
argumentCaptor<String>
helped me
n

natpryce

12/11/2018, 8:16 PM
If it’s a function, a lambda and a var would work, and require less code
6 Views