commit | 0edd8fc2eefaf6ecbd0485b74c8267c9d990280d | [log] [tgz] |
---|---|---|
author | Niek Haarman <haarman.niek@gmail.com> | Wed Jun 19 20:39:09 2019 +0200 |
committer | Niek Haarman <haarman.niek@gmail.com> | Wed Jun 19 20:39:09 2019 +0200 |
tree | eedb2fba09fc5edbe106b835302814f7e74d70ac | |
parent | 76198eab935700356643fd8b8d417aec9b09bee4 [diff] | |
parent | 84783a503221b19cef538b64cced9bc5eedc7901 [diff] |
Merge branch 'unlimitedsola-2.x' into 2.x
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.