标签:使用 alt 负数 总结 小学 void hex 图片 bubuko
211606361 何承华
211606377覃一霸
1.需使用junit插件写测试代码
@Test//测试传入的参数是否正确
public void test() {
String[] str = {"-grade","3","n","10"};
assertEquals(true ,MathExam6361.jibu(str));
}
@Test//测试传入的年级超过范围是否正确
public void test1() {
String[] str = {"-grade","0","n","10"};
assertEquals(false ,MathExam6361.jibu(str));
}
@Test//测试传入的题数超过范围是否正确
public void test2() {
String[] str = {"-grade","3","n","101"};
assertEquals(false ,MathExam6361.jibu(str));
}
@Test//测试传入的参数超过范围是否正确
public void test3() {
String[] str = {"-grade","0","n","101"};
assertEquals(false ,MathExam6361.jibu(str));
}
@Test//测试传入的参数为负数是是否正确
public void test4() {
String[] str= {"-grade","-1","n","-10"};
assertEquals(false ,MathExam6361.jibu(str));
}
@Test//测试传入的年级为小数是否正确
public void test5() {
String[] str = {"-grade","3.0","n","10"};
assertEquals(true ,MathExam6361.jibu(str));
}
}
这是这次作业目前的进度,接下来我会在国庆继续写完
标签:使用 alt 负数 总结 小学 void hex 图片 bubuko
原文地址:https://www.cnblogs.com/98-10-22-25/p/9728951.html