Skip to content

Robolectric Testing  #27

@Dalakoti07

Description

@Dalakoti07

Hi @skydoves, I am using the library and injecting component like this the fragment with Hilt as DI framework.
@Inject lateinit var appSettingsComponent: PreferenceComponent_AppSettingsComponent

Now I am creating corresponding test class for this fragment, but I am unable to mockk the component class and inject in the fragment.

One of the possible solution is to uninstall the PrefModule and bind own fake AppSettingComponentImpl.

@skydoves is there a better than creating fakes, un-installing and binding the fake implementation.

Some magic stuff which works out of the box

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions