コード例 #1
0
 @Test
 public void calculate() {
   measurable.setMeasure(Metric.LINES_OF_CODE, 10);
   measurable.setMeasure(Metric.COMMENT_LINES, 10);
   assertEquals(0.5, measurable.getDouble(Metric.COMMENT_LINES_DENSITY), 0.01);
 }
コード例 #2
0
 @Test
 public void calculateDensityOnEmptyFile() {
   measurable.setMeasure(Metric.LINES_OF_CODE, 0);
   measurable.setMeasure(Metric.COMMENT_LINES, 0);
   assertEquals(0, measurable.getDouble(Metric.COMMENT_LINES_DENSITY), 0.01);
 }