commit | 6cf8557ca09aeead313a209208b9cb7d3993d29e | [log] [tgz] |
---|---|---|
author | Niek Haarman <haarman.niek@gmail.com> | Fri Aug 19 22:04:41 2016 +0200 |
committer | Niek Haarman <haarman.niek@gmail.com> | Fri Aug 19 22:05:13 2016 +0200 |
tree | 91e5c4f9cba37eb63917659f5d3816e526e3a777 | |
parent | d07a2c900d1f24aa5152d8143a87c8d66562cc90 [diff] |
Update README.md
A small library that provides helper functions to work with Mockito in Kotlin.
Mockito-Kotlin is available on JCenter. For Gradle users, add the following to your build.gradle
:
repositories { jcenter() } 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 */ classUnderText.doAction() /* Then */ verify(mock).doSomething(any()) }
For more info and samples, see the Wiki.