https://kotlinlang.org logo
#mockk
Title
# mockk
h

huehnerlady

07/21/2020, 7:47 AM
Hi, I am pretty new to kotlin and just read a lot about mockk. I used it as well and it does work marvelously. But I am not 100% sure when I should use a slot capturing and when I use just the verify method without it. Can someone help me with giving useCases when I should use these 2 methods?
☑️ 1
g

gildor

07/21/2020, 7:51 AM
“slock capturing”?
Do you mean capturing with slot?
Slot used only when you want to use wildcard (like any()) for argument, but also know exactly what is passed there, usually it used to provide dynamic result for captured function If
verify
works for your case, always use verify
h

huehnerlady

07/21/2020, 8:55 AM
@gildor many thanks, yes I meant slot, sorry, I corrected it in my question. Ok I will use verify alone then for now, many thanks 🙂
2 Views