TestableAndroidInjection

object TestableAndroidInjection

AndroidInjection wrapper that allows customizing dependency injection of Activity or Fragment.

Important: Methods and properties of this object should be used only for testing purposes.

Functions

Link copied to clipboard
fun inject(activity: Activity)

Wrap AndroidInjection.inject method with helpful utilities for better testability of Activity class.

fun inject(fragment: Fragment)

Wrap AndroidInjection.inject method with helpful utilities for better testability of Fragment class.

Properties

Link copied to clipboard
var onActivityInject: (Activity) -> Unit? = null

Callback invoked when Activity class is being injected. It should be used in tests for manual dependency injection of Activity class.

Link copied to clipboard
var onFragmentInject: (Fragment) -> Unit? = null

Callback invoked when Fragment class is being injected. It should be used in tests for manual dependency injection of Fragment class.