commit | b50831bf5ada75e313c0d0676008fd2d2aae9795 | [log] [tgz] |
---|---|---|
author | Niek Haarman <haarman.niek@gmail.com> | Sat Nov 12 22:41:20 2016 +0100 |
committer | Niek Haarman <haarman.niek@gmail.com> | Sat Nov 12 22:41:20 2016 +0100 |
tree | d910663d0062b02d3151711e6b45a28e6f8dfb2b | |
parent | ebc61470b106ba6e4067fcd28497ebdcedfbc635 [diff] |
Fix release build config
A small library that provides helper functions to work with Mockito in Kotlin.
Mockito-Kotlin is available on Maven Central. For Gradle users, add the following to your build.gradle
, replacing x.x.x
with the latest version:
repositories { mavenCentral() } dependencies { testCompile "com.nhaarman:mockito-kotlin:x.x.x" }
A test using Mockito-Kotlin typically looks like the following:
@Test fun a(){ /* 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.