use of org.jacoco.core.analysis.ICounter in project jacoco by jacoco.
the class CyclomaticComplexityTest method testIf2.
@Test
public void testIf2() throws Exception {
instrument(If.class);
target.test(0);
final ICounter complexity = analyze();
assertEquals(CounterImpl.getInstance(1, 1), complexity);
}
use of org.jacoco.core.analysis.ICounter in project jacoco by jacoco.
the class CyclomaticComplexityTest method testTwoIf2.
@Test
public void testTwoIf2() throws Exception {
instrument(TwoIf.class);
target.test(-1);
final ICounter complexity = analyze();
assertEquals(CounterImpl.getInstance(2, 1), complexity);
}
use of org.jacoco.core.analysis.ICounter in project jacoco by jacoco.
the class CyclomaticComplexityTest method testSimple1.
@Test
public void testSimple1() throws Exception {
instrument(Simple.class);
final ICounter complexity = analyze();
assertEquals(CounterImpl.getInstance(1, 0), complexity);
}
use of org.jacoco.core.analysis.ICounter in project jacoco by jacoco.
the class CyclomaticComplexityTest method testSwitch3.
@Test
public void testSwitch3() throws Exception {
instrument(Switch.class);
target.test(0);
target.test(1);
final ICounter complexity = analyze();
assertEquals(CounterImpl.getInstance(1, 2), complexity);
}
use of org.jacoco.core.analysis.ICounter in project jacoco by jacoco.
the class CyclomaticComplexityTest method testNestedIf1.
@Test
public void testNestedIf1() throws Exception {
instrument(NestedIf.class);
final ICounter complexity = analyze();
assertEquals(CounterImpl.getInstance(3, 0), complexity);
}
Aggregations