【发布时间】:2018-08-29 10:08:51
【问题描述】:
如何为android方法和类编写单元测试?
例如:
public int dpToPx (Context context, int dp) {
float density = context.getResources().getDisplayMetrics().density;
return Math.round((float) dp * density);
}
【问题讨论】:
-
使用 espresso 来正确的 android 仪器测试以获取上下文和 android 相关方法的访问权限
标签: android unit-testing