????????????????????????????????????£?
package cn.hao.junit;
import junit.framework.Assert;
import cn.hao.service.PersonaService;
import android.test.AndroidTestCase;
public class PersonServiceTest extends AndroidTestCase {
public void testSave() throws Exception {
PersonaService service = new PersonaService();//new?????????
service.save(null);
}
public void testAdd() throws Exception {
PersonaService service = new PersonaService();
int actual = service.add(1?? 2);
Assert.assertEquals(3?? actual);
}
}
??
????????????е???????????android.test.AndroidTestCase???????????????????????????????Assert.assertEquals(3?? actual)?в???3??????(??????)????????actual???????????????
??????????????в?????
????????OutLine????У???????????->Run As->Android Junit Test?????????????????????????????????????????????????????????????????÷??????????Eclipse???????????????????????????????????????????
?????????????testSave()?????????????????????
?????????save()?????λ?????????????????÷????????????null???????????????