### Question:
QualityService { void countScenario(ScenarioCountDTO counts, ExecutedScenario executedScenario) { counts.setTotal(counts.getTotal() + 1); if (executedScenario.getErrors().isEmpty()) { counts.setPassed(counts.getPassed() + 1); } else { counts.setFailed(counts.getFailed() + 1); } }  void computeQuality(Execution execution);  }### Answer:
@Test public void countScenario_should_increment_total_count() { ScenarioCountDTO counts = new ScenarioCountDTO(); cut.countScenario(counts, passedScenario()); assertThat(counts.getTotal()).isEqualTo(1); }
@Test public void countScenario_should_increment_passed_count() { ScenarioCountDTO counts = new ScenarioCountDTO() .withFailed(7) .withPassed(2); ExecutedScenario executedScenario = new ExecutedScenario(); cut.countScenario(counts, executedScenario); assertThat(counts.getFailed()).isEqualTo(7); assertThat(counts.getPassed()).isEqualTo(3); }
@Test public void countScenario_should_increment_failed_count() { ScenarioCountDTO counts = new ScenarioCountDTO() .withFailed(7) .withPassed(2); cut.countScenario(counts, failedScenario()); assertThat(counts.getFailed()).isEqualTo(8); assertThat(counts.getPassed()).isEqualTo(2); }