AppComponentFactoryRule


class AppComponentFactoryRule : ExternalResource


JUnit Rule that let you define a AppComponentFactory before the tests starts and clean-up the factory after the test.

This rule is designed to be used with ActivityScenarioRule.

Example:

// We use `order`  to to ensure the `AppComponentFactoryRule` will always run BEFORE the
// `ActivityScenarioRule` so that your custom `AppComponentFactory` is available when the
// activity is launched.
@get:Rule(order = 1)
val factoryRule = AppComponentFactoryRule(MyAppComponentFactory())

@get:Rule(order = 2)
val activityRule = ActivityScenarioRule<MyActivity>()

Summary

Public constructors

Protected functions

open Unit
open Unit

Inherited functions

From org.junit.rules.ExternalResource
open Statement

Public constructors

AppComponentFactoryRule

AppComponentFactoryRule(factory: AppComponentFactory)

Protected functions

after

protected open fun after(): Unit

before

protected open fun before(): Unit