@Test public void getQualityPercentage_should_return_100_when_no_scenario() { ScenarioCountDTO counts = new ScenarioCountDTO().withTotal(0); final int percentage = cut.getQualityPercentage(counts); assertThat(percentage).isEqualTo(100); }
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);  }