Guest User

Untitled

a guest
Feb 21st, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. class TestStuff {
  2.  
  3. val stuff = "1"
  4.  
  5. @RelaxedMockK
  6. lateinit var testService: TestService
  7.  
  8. @RelaxedMockK
  9. lateinit var testInterface: TestInterface
  10.  
  11. @Before
  12. fun setup() {
  13. MockKAnnotations.init(this)
  14.  
  15. every { testInterface.testStuff } returns stuff
  16. }
  17.  
  18. @Test
  19. fun testStuffCalled() {
  20. testService.testStuff(testInterface.testStuff)
  21.  
  22. verify { testService.testStuff(testInterface.testStuff) }
  23. }
  24. }
  25.  
  26. interface TestInterface {
  27. val testStuff: String
  28. }
  29.  
  30. class TestService {
  31.  
  32. fun testStuff(stuff: String) {
  33. }
  34. }
Add Comment
Please, Sign In to add comment