Created
June 23, 2022 21:41
-
-
Save jonfazzaro/1458c170fc390f120861e6d28ada2dd4 to your computer and use it in GitHub Desktop.
Use this assertion to test if a Kotlin class has a HiltViewModel annotation.
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
import org.junit.jupiter.api.Assertions.assertNotNull | |
inline fun <reified T : Any> assertIsHiltViewModel() { | |
assertNotNull(Class.forName("${T::class.qualifiedName}_HiltModules")) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment