= context.getComponent(FooComponent) val fooComponent by context.component(FooComponent) class FooFragment : Fragment() { private val fooComponent by component(FooComponent) // snip... }
val expectedValue = Foo() // Set a mock of FooRepository. mockComponent(FooRepository) { onBlocking { findFoo(any()) } doReturn expectedValue } val context = ApplicationProvider.getApplicationContext() val fooUseCase = FooUseCase(context) // TODO: Write test cases for fooUseCase. } }