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

Sergio Crespo Toubes

05/16/2019, 12:49 PM
Hello, exist a way with verify, check not all object parameters and only for example 3 parameters of 5? example
verify(exactly = 1) { mView.loadUser(user is {name = "sergio"}) }
and not
verify(exactly = 1) { mView.loadUser(user)}
o

oleksiyp

05/16/2019, 12:52 PM
Not exactly sure
What youve meaby
Meant
s

Sergio Crespo Toubes

05/16/2019, 12:52 PM
my verify crash because the object is not the same
o

oleksiyp

05/16/2019, 12:52 PM
It is poasible to check objects via lambda
s

Sergio Crespo Toubes

05/16/2019, 12:53 PM
and i would like not to use this
mView.loadUser(any())
o

oleksiyp

05/16/2019, 12:53 PM
Belive it is called
matcher
So
Should be possible
mView.loadUser(matcher { it.name == "something" }
)
s

Sergio Crespo Toubes

05/16/2019, 12:54 PM
i am going check
thanks
o

oleksiyp

05/16/2019, 12:54 PM
I may forgot exact name
But know that it definetelly exists
Welcome
s

Sergio Crespo Toubes

05/16/2019, 12:56 PM
it works perfect with
match
thanks
2 Views