commit | 1251c2d0d1e98b9560e6c505ac2ce570bae11b2e | [log] [tgz] |
---|---|---|
author | Niek Haarman <haarman.niek@gmail.com> | Sat Jun 03 15:35:21 2017 +0200 |
committer | Niek Haarman <haarman.niek@gmail.com> | Sat Jun 03 15:35:21 2017 +0200 |
tree | 3e59f99e8659d644fbb6559deeb6256fdb190d49 | |
parent | 6c29db1e6b35708648482ec727a40504e1879657 [diff] |
Update Mockito to 2.8.9
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.