Open larmic opened 4 years ago
@bohsen Hmm, but I want to do more assertions on the received argument. id
and text
of Tweet.kt
.
Use eq()
or argThat()
. I believe it's mentioned in the issue I referred to.
Maybe you can refactor my code above? argThat
only verifies one attribute at all.
I could, but I'm not going to.
Ok :/ I did not see the trick.
@larmic Or create your own TweetMatcher
.
But eq()
is the easiest.
val tweet1 = Tweet(1, "first tweet")
val tweet2 = Tweet(2, "second tweet")
verify(repositoryMock, Times(1)).persist(eq(tweet1))
verify(repositoryMock, Times(1)).persist(eq(tweet2))
Hi,
I'dont now if this is a bug. I'm trying to verify two arguments by using
check {}
. Of course I can use an argument capture, but I'm expecting this should working too.is green but logs assertion errors
Context