我想学JUnit Tesing
安卓。我做谷歌,现在我知道如何创建 JUnit 测试用例。但是我的问题是如何在那个类中编写逻辑,我不知道。
假设我想为自定义的listview编写测试用例,那我该如何实现呢?请给我一些指导。
public class CustomlistviewActivityTest extends TestCase {
protected void setUp() throws Exception {
super.setUp();
}
protected void tearDown() throws Exception {
super.tearDown();
}
public void testOnCreateBundle() { // this is oncreate method
fail("Not yet implemented");
}
public void testOnCreateContextMenuContextMenuViewContextMenuInfo() {
fail("Not yet implemented"); // this method is for the create the context menu
}
public void testOnContextItemSelectedMenuItem() {
fail("Not yet implemented"); // this method is for the select the item of the context menu
// on select items call the below method named testFunction1()
}
public void testFunction1() {
fail("Not yet implemented"); // display toast
}
public void testFunction2() {
fail("Not yet implemented"); // display toast
}
public void testOnItemClick() {
fail("Not yet implemented"); // display toast
}
}
谢谢。