Last active
June 20, 2022 14:48
-
-
Save micHar/53dbbad0ea524c394b6391bd9f8d102f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
fun `should not increase the playback counter until the sound has finished playing`() = runTest { | |
val soundPlayer = mockk<SoundPlayer>() | |
coEvery { soundPlayer.playSound() } coAnswers { delay(1000) } | |
val sut = MediaPlayer(this, soundPlayer) | |
sut.play() | |
advanceTimeBy(500) | |
sut.playbackCounter shouldBe 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment