commit | fdeccbd8cf0c2fc703e3e9642f49567fb7b41604 | [log] [tgz] |
---|---|---|
author | Niek Haarman <haarman.niek@gmail.com> | Sat Nov 25 15:58:06 2017 +0100 |
committer | Niek Haarman <haarman.niek@gmail.com> | Sat Nov 25 15:58:06 2017 +0100 |
tree | 75f6401e72d2839ddd09f07de3fa3976c6b6dec3 | |
parent | 1e496d6e6952f03c32827a2b2b01f9b6825569ee [diff] |
Update Gradle versions plugin to 0.17.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:
testCompile "com.nhaarman: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.