Created
April 17, 2020 11:12
-
-
Save peter-tackage/d28e7fc4b8fc4b52b77ed57ea34464b7 to your computer and use it in GitHub Desktop.
Simulates teardown of Android ViewModel
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
fun ViewModel.tearDown() { | |
ViewModel::class.java.getDeclaredMethod("clear") | |
.apply { isAccessible = true }(this) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment