Answers for "mockk"

0

mockk

object MockObj {
  fun add(a: Int, b: Int) = a + b
}

mockkObject(MockObj) // applies mocking to an Object

assertEquals(3, MockObj.add(1, 2))

every { MockObj.add(1, 2) } returns 55

assertEquals(55, MockObj.add(1, 2))
Posted by: Guest on June-28-2021

Code answers related to "mockk"

Browse Popular Code Answers by Language