Skip to content

Instantly share code, notes, and snippets.

@mcatta
Created March 28, 2020 14:33
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mcatta/7cf581b65f8373fba3aac0f0ba719542 to your computer and use it in GitHub Desktop.
An example to testing with method spyk
@Test
fun `Test log() method`() {
val spiedPresenter = spyk(mainPresenter)
every { dataRepository.fetchData() } returns listOf()
spiedPresenter.fetchData()
verify(exactly = 1) { spiedPresenter.log(any(), any()) }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment