我想在android中学习JUnit Tesing
。我做谷歌,现在我知道如何创建JUnit测试用例。但我的问题是如何在该类中编写逻辑,我不知道。
假设我想为自定义列表视图编写测试用例,那么我该如何实现?请给我一些方向。
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
}
}
感谢。