Triangle 测试
Write a java program for the triangle problem and test the program with Junit.
Description of triangle problem:
Function triangle takes three integers a,b,c which are length of triangle sides; calculates whether the triangle is equilateral, isosceles, or scalene.
使用Idea IDE
首先下载JUnit和JunitGenerator 2.0插件
设置 JUnit Generator
设置Project Structure
选择JUnit4。
测试结果
测试覆盖率,idea中使用coverage来显示
测试覆盖率输出结果
点击菜单Analyze--> generate coverage report查看报告