被测类
public class Student {
@Autowired
private Card card;
public boolean judgeNumber(Long uid) throws ServiceException {
if (uid.equals(-1)) {
throw new RuntimeException();
}
if (uid.equals(3)) {
return true;
}
card.isExist(null);
return false;
}
private boolean checkIsBlank(String name) {
return StringUtil.isBlank(name);
}
private void process(Long uid) throws ServiceException {
//doing
}
private void preProcess(String name, Long uid) {
checkIsBlank(name);
process(uid);
}
public static Integer add(Integer a, Integer b) {
return a + b;
}
}
一、TC的设计和命名
测试类的命名:
被测类名 + Test