Android Studio使用单元测试
package com.mytest.android.sqlite;
import android.database.sqlite.SQLiteDatabase;
import android.test.InstrumentationTestCase;
/**
* Created by Administrator on 2015/12/8.
*/
public class TestClass extends InstrumentationTestCase{
//测试执行前调用的方法
@Override
protected void setUp() throws Exception {
super.setUp();
}
//测试执行后调用的方法
@Override
protected void tearDown() throws Exception {
super.tearDown();
}
public void test() throws Exception{
assertEquals(3, 2);
}
public void testCreateDb() throws Exception{
MyOpenHelper oh = new MyOpenHelper(getInstrumentation().getContext(),"my.db",null,1);
SQLiteDatabase db = oh.getReadableDatabase();
}
} 相关推荐
88570191 2011-08-22
zjwijy 2012-02-05
qingmumu 2011-11-18
CampC 2015-12-23
wuzhixiu00 2016-11-21
86133550 2015-12-23
wuzhixiu00 2012-12-27
86133550 2012-07-27
Wicrecend 2012-06-14
leeo00 2012-04-07
wuzhixiu00 2011-03-09
xiaoshengyige 2011-03-08
XPY 2010-10-29
CampC 2010-04-26