| commit | 9a3b7de2929e1cdf1d56e8595b07ce3ef2be8cb2 | [log] [tgz] |
|---|---|---|
| author | Niek Haarman <haarman.niek@gmail.com> | Fri Sep 09 12:30:15 2016 +0200 |
| committer | Niek Haarman <haarman.niek@gmail.com> | Fri Sep 09 12:30:15 2016 +0200 |
| tree | 55dc192e8eb4a3f853c01ee643cb07438e7d139a | |
| parent | 8d53bad29fc2052a7cac138f5e02e35d844b020a [diff] |
Introduce argForWhich() as an alias for argThat()
A small library that provides helper functions to work with Mockito in Kotlin.
Mockito-Kotlin is available on JCenter. For Gradle users, add the following to your build.gradle:
repositories { jcenter() } 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 */ classUnderText.doAction() /* Then */ verify(mock).doSomething(any()) }
For more info and samples, see the Wiki.