Skip to content

Instantly share code, notes, and snippets.

@alouanemed
Created March 17, 2018 13:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alouanemed/1064483f554a93d6ed526680ce15bcfc to your computer and use it in GitHub Desktop.
Save alouanemed/1064483f554a93d6ed526680ce15bcfc to your computer and use it in GitHub Desktop.
@get:Rule
val activityTestRule = object : IntentsTestRule<MainActivity>(MainActivity::class.java, true,
true) {
override fun beforeActivityLaunched() {
super.beforeActivityLaunched()
var myApp = InstrumentationRegistry.getTargetContext().applicationContext as HarvestOrderApp
myApp.dispatchingActivityInjector = MockAndroidInjectorFragment<BuyerOrdersListFragment, MainActivity> {
this.mPresenterFactory = ordersPresenterFactors
}
myApp.dispatchingActivityInjector = MockAndroidInjectorFragment<BuyerAddressesFragment, UiContainerActivity> {
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment