Created
June 20, 2022 14:43
-
-
Save micHar/f7bb6cd59590844eb039934adc45db0a to your computer and use it in GitHub Desktop.
This file contains hidden or 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 increase the playback counter after the sound has finished playing`() = runTest { | |
val soundPlayer = mockk<SoundPlayer>() | |
coEvery { soundPlayer.playSound() } coAnswers { delay(1000) } | |
val sut = MediaPlayer(this, soundPlayer) | |
sut.play() | |
advanceTimeBy(1000) | |
sut.playbackCounter shouldBe 1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment