commit | 6837f30a09a753dc56a7d7d35598502e463dc6c5 | [log] [tgz] |
---|---|---|
author | Niek Haarman <haarman.niek@gmail.com> | Thu May 10 11:32:40 2018 +0200 |
committer | Niek Haarman <haarman.niek@gmail.com> | Thu May 10 11:32:40 2018 +0200 |
tree | b4b8914c15689edaf16f57e17ea534512ccead0d | |
parent | 6f9e1a7cc3eca9c2d8a6c54a0e533b772951d5d8 [diff] |
Include tests for default 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.