@Test public void testAnalyseSourceCodeWithNoNoSonar() { File file = new File(this.getClass().getResource("/Math3.php").getPath()); Source source = NoSonarAndCommentedOutLocSensor.analyseSourceCode(file); assertEquals(0, source.getNoSonarTagLines().size()); assertEquals(5, source.getMeasure(Metric.COMMENTED_OUT_CODE_LINES)); }
// TEST for SONARPLUGINS-662 @Test public void testAnalyseSourceCodeWithMultiLineString() { File file = new File(this.getClass().getResource("/Math4.php").getPath()); Source source = NoSonarAndCommentedOutLocSensor.analyseSourceCode(file); assertEquals(1, source.getNoSonarTagLines().size()); assertEquals(91, (int) source.getNoSonarTagLines().iterator().next()); assertEquals(5, source.getMeasure(Metric.COMMENTED_OUT_CODE_LINES)); }