commit | 12e390c2252b61acae2e00f939cc206938555f3c | [log] [tgz] |
---|---|---|
author | Jossi Wolf <jossiwolf@gmx.net> | Tue Oct 09 13:34:44 2018 +0200 |
committer | GitHub <noreply@github.com> | Tue Oct 09 13:34:44 2018 +0200 |
tree | f125e4bcd64719cb1c46b706374ac30747c56cc7 | |
parent | 98584ecde2a31a7a242fbff11e342eac42d64a13 [diff] |
Update to Kotlin 1.3-RC-146
A small library that provides helper functions to work with Mockito in Kotlin.
Mockito-Kotlin is available on Maven Central and JCenter. For Gradle users, add the following to your build.gradle
, replacing x.x.x
with the latest version:
testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:x.x.x"
A test using Mockito-Kotlin typically looks like the following:
@Test fun doAction_doesSomething(){ /* Given */ val mock = mock<MyClass> { on { getText() } doReturn "text" } val classUnderTest = ClassUnderTest(mock) /* When */ classUnderTest.doAction() /* Then */ verify(mock).doSomething(any()) }
For more info and samples, see the Wiki.