Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class TestStuff {
- val stuff = "1"
- @RelaxedMockK
- lateinit var testService: TestService
- @RelaxedMockK
- lateinit var testInterface: TestInterface
- @Before
- fun setup() {
- MockKAnnotations.init(this)
- every { testInterface.testStuff } returns stuff
- }
- @Test
- fun testStuffCalled() {
- testService.testStuff(testInterface.testStuff)
- verify { testService.testStuff(testInterface.testStuff) }
- }
- }
- interface TestInterface {
- val testStuff: String
- }
- class TestService {
- fun testStuff(stuff: String) {
- }
- }
Add Comment
Please, Sign In to add comment