commit | 8118f1ae6c78adf09b5434da67c303f336412cb7 | [log] [tgz] |
---|---|---|
author | Niek Haarman <haarman.niek@gmail.com> | Mon Dec 19 14:25:43 2016 +0100 |
committer | Niek Haarman <haarman.niek@gmail.com> | Mon Dec 19 14:25:43 2016 +0100 |
tree | 2ca39986c459ba50eb60a08f5af836ee7df2118a | |
parent | 327d431e9d577b8da2ba5222c52fa5d7b4498ca2 [diff] |
Update Mockito to 2.3.9
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.