commit | ab88f799f23be28be758abc9502581a8ca986f1c | [log] [tgz] |
---|---|---|
author | Niek Haarman <haarman.niek@gmail.com> | Mon Oct 29 21:48:23 2018 +0100 |
committer | Niek Haarman <haarman.niek@gmail.com> | Mon Oct 29 21:48:23 2018 +0100 |
tree | 04644e7ae1bc3e1593658777f129c16e80f14b62 | |
parent | ab51bb3c1a80c0eea795a3bdd0ae737d0dab917e [diff] |
Update Gradle versions plugin to 0.20.0
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.