如何在Dagger

时间:2019-07-03 12:58:06

标签: android junit dagger-2 junit-runner

以下:这是我的活动代码

@Inject DemoApplication application;
public class DemoActivity extends Activity {

   @Override
    protected void  onCreate(Bundle savedInstanceState) {
        ProductHelper  helper=new ProductHelper();
    }
}

因此,我如何才能像模拟一样通过此注入的演示应用程序以及测试中的帮助程序。我正在使用活动规则来获取活动实例。例如 activityrule.getActivity()

0 个答案:

没有答案