Last active
September 23, 2019 14:40
-
-
Save christianb/f6abb7f40a67ae196dd163bfa5b389a2 to your computer and use it in GitHub Desktop.
How to unit testing runnable and handlers
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
| every { handler.removeCallbacks(any()) } returns Unit | |
| every { handler.postDelayed(any(), any()) } answers { | |
| // capture runnable | |
| (this.args[0] as Runnable).run() | |
| true | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment