commit | c974db088c76aec042faef212c63e83d4aaecead | [log] [tgz] |
---|---|---|
author | Niek Haarman <haarman.niek@gmail.com> | Tue Nov 15 22:03:23 2016 +0100 |
committer | Niek Haarman <haarman.niek@gmail.com> | Tue Nov 15 22:03:23 2016 +0100 |
tree | 4aa593e2714790f0518622fe0b9a4524b929b529 | |
parent | e6f6d2c9563a4f958eb52089853ffe9a05adff52 [diff] |
Update Mockito to 2.2.17
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.