Android下编写单元测试步骤
##android下编写单元测试代码的步骤
1.编写测试类 extends AndroidTestCase
2.编写测试的方法 修饰符是public 直接抛出异常给测试框架 throws Exception
3.进行断言
4.清单文件进行配置
在application节点配置
<user-library android:name="android.test.runner" />
在manifest节点里面配置
<instrumentation android:name="android.test.InstrumentationTestRunner" android:targetPackage="com.zyn.junit">
</instrumentation>
5.运行测试用例。绿条测试通过,红条测试失败
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。