Last active
June 12, 2017 11:24
-
-
Save sczerwinski/bcd7e38a02638c249878b78b2e9e6cd0 to your computer and use it in GitHub Desktop.
Kotlin functions providing ActivityTestRule and IntentsTestRule with a simplified syntax.
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
import android.app.Activity | |
import android.support.test.espresso.intent.rule.IntentsTestRule | |
import android.support.test.rule.ActivityTestRule | |
inline fun <reified T : Activity> activityTestRule(initialTouchMode: Boolean = false, launchActivity: Boolean = true) = | |
ActivityTestRule(T::class.java, initialTouchMode, launchActivity) | |
inline fun <reified T : Activity> intentsTestRule(initialTouchMode: Boolean = false, launchActivity: Boolean = true) = | |
IntentsTestRule(T::class.java, initialTouchMode, launchActivity) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example usage: