com.nhaarman.mockito_kotlin.BDDMockito.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mockito-kotlin Show documentation
Show all versions of mockito-kotlin Show documentation
Using Mockito with Kotlin.
The newest version!
package com.nhaarman.mockito_kotlin
import org.mockito.BDDMockito
fun given(methodCall: T): BDDMockito.BDDMyOngoingStubbing = BDDMockito.given(methodCall)
fun given(methodCall: () -> T) = given(methodCall())
fun then(mock: T): BDDMockito.Then = BDDMockito.then(mock)
infix fun BDDMockito.BDDMyOngoingStubbing.willAnswer(value: () -> T): BDDMockito.BDDMyOngoingStubbing = willAnswer { value() }
infix fun BDDMockito.BDDMyOngoingStubbing.willReturn(value: () -> T): BDDMockito.BDDMyOngoingStubbing = willReturn(value())
infix fun BDDMockito.BDDMyOngoingStubbing.willThrow(value: () -> Throwable): BDDMockito.BDDMyOngoingStubbing = willThrow(value())