|
这是我用java程序编写的一个方法,其中被测试的类为ScholarshipSystem。在这个类中内容为
public class ScholarshipSystem {
public int calculateScholarship(int score){
int scholarship = 0;
if(score<2000)
return scholarship;
else
scholarship = 500;
scholarship = scholarship + ((score - 2000)/100) * 500;
return scholarship;
}
}
用fit编写的测试代码为testclass文件夹中的CalculateScholarship类
import fit.ColumnFixture;
public class CalculateScholarship extends ColumnFixture {
public int score;
public int scholarship(){
ScholarshipSystem scholar = new ScholarshipSystem();
return scholar.calculateScholarship(score);
}
}
测试表格放在test目录下,生成结果文件可是提示出错。对java不熟,各位大侠有没知道是哪一步出问题了,调用的时候吗?
|
|