android单元测试

来源:互联网 发布:安卓 服务器软件 编辑:程序博客网 时间:2024/06/08 01:50

1.首先在项目(androidTest下创建类)
这里写图片描述
测试类必须以Test结尾

2.创建测试类需要继承InstrumentationTestCase类

package com.example.rwstore;import android.test.InstrumentationTestCase;import android.util.Log;/** * Created by joy on 2015/12/21. */public class CeshiTest extends InstrumentationTestCase{    public void test11(){        Log.e("test","测试11");    }    public void test22(){        Log.e("test","测试22");    }}

测试类的方法必须以test开头


3.选中要测试的方法
这里写图片描述

这里写图片描述
点击OK

这里写图片描述
点击箭头启动

0 0
原创粉丝点击