commit | f9f3abc42dd55a991ffa2699f8d0987a68947d90 | [log] [tgz] |
---|---|---|
author | Niek Haarman <haarman.niek@gmail.com> | Thu Jan 19 22:20:06 2017 +0100 |
committer | Niek Haarman <haarman.niek@gmail.com> | Sat Jan 21 15:17:22 2017 +0100 |
tree | 543dd06ab41ce002bce07e4cf47659beda391a37 | |
parent | a804d1e996017b609ae5df0a97253b4011c24ce1 [diff] |
Add regression tests in preparation for settings API
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.