标签:
1.新建测试类继承AndroidTestCase
package cn.com.smartcost.scexam.test; import cn.com.smartcost.scexam.entity.ExamLibEntity; import cn.com.smartcost.scexam.entity.SubjectEntity; import cn.com.smartcost.scexam.service.ExamLibService; import cn.com.smartcost.scexam.service.SubjectExamService; import android.test.AndroidTestCase; public class ScExamTest extends AndroidTestCase{ public void testDelete()throws Exception{ ExamLibService service = new ExamLibService(this.getContext()); service.delete("2"); } }
<application> <uses-library android:name="android.test.runner" /> </application>
<instrumentation android:name="android.test.InstrumentationTestRunner" android:targetPackage="cn.com.xxx.xxx" android:label="Tests for My App" />
标签:
原文地址:http://blog.csdn.net/howlaa/article/details/46043447