Created
October 29, 2016 20:27
-
-
Save dstarcev/6046c5c54b3e502123b6898955b87115 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import be.vergauwen.simon.mockito1_kotlin.any | |
import be.vergauwen.simon.mockito1_kotlin.doNothing | |
import be.vergauwen.simon.mockito1_kotlin.spy | |
import be.vergauwen.simon.mockito1_kotlin.whenever | |
import org.junit.Test | |
class KotlinMockitoTest { | |
@Test | |
fun test() { | |
val spy = spy<TestInterface>(TestClass()) | |
doNothing() | |
.whenever(spy).call(any()) | |
spy.call(TestClass()) | |
} | |
interface TestInterface { | |
fun call(obj: TestInterface) | |
} | |
open class TestClass : TestInterface { | |
override fun call(obj: TestInterface) { | |
TODO() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment