@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); }
@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); }