commit | 19969dffd3b7fdf210e1acaa998c5402d8dd0f00 | [log] [tgz] |
---|---|---|
author | Niek Haarman <haarman.niek@gmail.com> | Sat Feb 11 18:53:07 2017 +0100 |
committer | Niek Haarman <haarman.niek@gmail.com> | Sat Feb 11 19:17:31 2017 +0100 |
tree | c061213e76b87e0df9a179c97d41ca2626f36d50 | |
parent | eb0b113539767b787922c172625fe2c92ada1ae1 [diff] |
Update Mockito to 2.7.5
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:
testCompile "com.nhaarman: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.