commit | b850ab164452a852ec43eb7e720216439554d7a7 | [log] [tgz] |
---|---|---|
author | Niek Haarman <haarman.niek@gmail.com> | Wed Jun 19 20:42:53 2019 +0200 |
committer | Niek Haarman <haarman.niek@gmail.com> | Wed Jun 19 20:42:53 2019 +0200 |
tree | 37c34e3e0472819d25ae2d53a88d9c6ba8803120 | |
parent | 0edd8fc2eefaf6ecbd0485b74c8267c9d990280d [diff] |
Test against Kotlin 1.3.40
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.