MetricComputer toDecorate = new MetricComputerBuilder().withClassRepository(repo).build();
decoratedComputer = new MetricComputerJavaDecorator(toDecorate, repo);
}
public void testOverridableTcc0Cost() throws Exception {
MethodCost methodCost = cost("void methodOverridableTcc4()");
assertEquals(4, methodCost.getCost().getCyclomaticComplexityCost());
assertEquals(0, methodCost.getCost().getGlobalCost());
assertEquals(0, methodCost.getTotalCost().getGlobalCost());
assertEquals(4, methodCost.getTotalCost().getCyclomaticComplexityCost());
methodCost = cost("void methodTcc0BecauseOverridableMethodCalls()");
assertEquals(0, methodCost.getCost().getCyclomaticComplexityCost());
assertEquals(0, methodCost.getCost().getGlobalCost());
assertEquals(0, methodCost.getTotalCost().getGlobalCost());
assertEquals(0, methodCost.getTotalCost().getCyclomaticComplexityCost());
}