Android单元测试步骤
来源:互联网 发布:触摸屏软件下载 编辑:程序博客网 时间:2024/06/05 22:58
1. 写一个类继承自AndroidTestCase
public class TestCountService extends AndroidTestCase {
// 第一步配置继承AndroidTestCase
public void testAdd() throws Exception {
CountService s = new CountService();
int result = s.add(3, 5);
//使用断言
assertEquals(8, result);
}
}
2.在manifest下配置指令集
<instrumentation
android:name="android.test.InstrumentationTestRunner"
android:targetPackage="com.example.testthreadhandler" />
android:targetPackage=""中填写的是你要测试的项目包名
3.在application的节点下使用的函数库
<uses-library android:name="android.test.runner" />
0 0
- Android单元测试的步骤
- Android单元测试创建步骤
- Android单元测试步骤
- Android 单元测试方法与步骤
- Android 单元测试方法与步骤
- Android下编写单元测试步骤
- 浅谈Android Studio单元测试步骤
- Android添加单元测试的方法与步骤
- android 中使用单元测试 Junit的步骤
- android开发中junit单元测试实施步骤
- VS2012 单元测试步骤 c++
- eclipse JUnit4单元测试步骤
- 2. 单元测试的步骤
- 单元测试实施步骤
- Java JUnit4单元测试步骤
- android 单元测试
- Android单元测试
- Android单元测试
- HA(高可用)系统设计原则
- MySQL主从同步/复制
- spring security的配置
- app 被拒原因
- 图片轮播
- Android单元测试步骤
- 一、MTK6580 平台 Camera 驱动整体框架
- RI和URL的区别
- 单点登录SSO的实现原理
- 移除视图
- git 代码库回滚
- Android版本列表
- Notepad++编译C语言代码的配置过程
- 用strace工具跟踪系统调用