Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save enginebai/903ba706ff5e69b24a3b3ed3eacc6e93 to your computer and use it in GitHub Desktop.

Select an option

Save enginebai/903ba706ff5e69b24a3b3ed3eacc6e93 to your computer and use it in GitHub Desktop.
ArchiveTTest
package com.machipopo.swag.feature.profile.archive
import org.junit.Before
import org.junit.Test
import org.mockito.Mock
import org.mockito.Mockito
class ArchiveTTest {
@Before
fun setUp() {
// init mock instance
}
@Test
fun `when load archive then view show list`() {
// arrange
val view = ArchiveTView()
val repo = ArchiveTRepo()
val target = ArchiveTPresenter(view, repo)
val actaul = listOf<ArchiveT>(item)
Mockito.`when`(repo.getArchives()).thenReturn(actaul)
//act
target.getArchives()
//assert
Mockito.verify(view).showArchives(actaul)
}
@Test
fun `when load archive is empty then view show empty view`() {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment