use of org.jacoco.core.analysis.ICounter in project jacoco by jacoco.
the class CyclomaticComplexityTest method testSwitch1.
@Test
public void testSwitch1() throws Exception {
instrument(Switch.class);
final ICounter complexity = analyze();
assertEquals(CounterImpl.getInstance(3, 0), complexity);
}
use of org.jacoco.core.analysis.ICounter in project jacoco by jacoco.
the class CyclomaticComplexityTest method testSwitch2.
@Test
public void testSwitch2() throws Exception {
instrument(Switch.class);
target.test(0);
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 testNestedIf3.
@Test
public void testNestedIf3() throws Exception {
instrument(NestedIf.class);
target.test(-1);
target.test(0);
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 testTwoIf4.
@Test
public void testTwoIf4() throws Exception {
instrument(TwoIf.class);
target.test(-1);
target.test(+1);
final ICounter complexity = analyze();
assertEquals(CounterImpl.getInstance(0, 3), complexity);
}
use of org.jacoco.core.analysis.ICounter in project jacoco by jacoco.
the class CyclomaticComplexityTest method testNestedIf4.
@Test
public void testNestedIf4() throws Exception {
instrument(NestedIf.class);
target.test(-1);
target.test(0);
target.test(+1);
final ICounter complexity = analyze();
assertEquals(CounterImpl.getInstance(0, 3), complexity);
}
Aggregations