@Test public void getQualityPercentage_should_truncate_instead_of_round_to_not_return_100_when_not_fully_passed() { ScenarioCountDTO counts = new ScenarioCountDTO().withPassed(199).withTotal(200); final int percentage = cut.getQualityPercentage(counts); assertThat(percentage).isEqualTo(99); }
int getQualityPercentage(ScenarioCountDTO counts) { if (counts.getTotal() <= 0) { return 100; } return 100 * counts.getPassed() / counts.getTotal(); }
QualityService { int getQualityPercentage(ScenarioCountDTO counts) { if (counts.getTotal() <= 0) { return 100; } return 100 * counts.getPassed() / counts.getTotal(); } }
QualityService { int getQualityPercentage(ScenarioCountDTO counts) { if (counts.getTotal() <= 0) { return 100; } return 100 * counts.getPassed() / counts.getTotal(); }  }
QualityService { int getQualityPercentage(ScenarioCountDTO counts) { if (counts.getTotal() <= 0) { return 100; } return 100 * counts.getPassed() / counts.getTotal(); }  void computeQuality(Execution execution); }
QualityService { int getQualityPercentage(ScenarioCountDTO counts) { if (counts.getTotal() <= 0) { return 100; } return 100 * counts.getPassed() / counts.getTotal(); }  void computeQuality(Execution execution);  }