commit | 6f9e1a7cc3eca9c2d8a6c54a0e533b772951d5d8 | [log] [tgz] |
---|---|---|
author | Danny Preussler <danny.preussler@vimn.com> | Sat Dec 09 22:19:20 2017 +0100 |
committer | Niek Haarman <haarman.niek@gmail.com> | Sat Feb 03 18:29:12 2018 +0100 |
tree | b7245d2853e7edf4f952911180d4f43efe5dfa80 | |
parent | d4b8fecb77c5d21e6c72dfebf1adfda355b1f718 [diff] |
better inOrder for single arguments
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.