Skip to content

Instantly share code, notes, and snippets.

@AOrobator
Created April 7, 2018 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AOrobator/0ffcc2ded1a562242fdf2cb1e41ccfe9 to your computer and use it in GitHub Desktop.
Save AOrobator/0ffcc2ded1a562242fdf2cb1e41ccfe9 to your computer and use it in GitHub Desktop.
Tests don't cover all bugs
@Test
fun `When unscanned song clicked, song is scanned into library`() {
val presenter = FolderBrowsingPresenter(queue, MockSongRepository())
val target: FolderBrowsingPresenter.Target = mock()
presenter.attach(target)
presenter.onUnscannedSongClicked(
DirectoryItemSong(
name = "01 Get You.m4a",
lastModifiedTime = 1234L,
inDatabase = false,
path = "/sdcard/Music/Daniel Caesar/Freudian/01 Get You.m4a",
size = 9001
)
)
verify(target).showLoading()
verify(target).hideLoading()
verify(target).playSong(420L.toSongId())
verifyNoMoreInteractions(target)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment