@Test public void itShouldSetRawTimeScoredForCleanRun() { when(run.getCones()).thenReturn(0); interactor.score(scoredRun); verify(scoredRun).setRawTimeScored(eq(TestConstants.RUN_RAW_TIME)); }
public void score(ScoredRun scoredRun) { BigDecimal eventConePenaltySeconds = scoredRun.getRun().getEvent().getConePenaltySeconds(); BigDecimal runCones = BigDecimal.valueOf(scoredRun.getRun().getCones()); BigDecimal conePenaltySeconds = eventConePenaltySeconds.multiply(runCones); BigDecimal rawTimeScored = scoredRun.getRun().getRawTime().add(conePenaltySeconds); scoredRun.setRawTimeScored(rawTimeScored); }
RawTimeScoringInteractor { public void score(ScoredRun scoredRun) { BigDecimal eventConePenaltySeconds = scoredRun.getRun().getEvent().getConePenaltySeconds(); BigDecimal runCones = BigDecimal.valueOf(scoredRun.getRun().getCones()); BigDecimal conePenaltySeconds = eventConePenaltySeconds.multiply(runCones); BigDecimal rawTimeScored = scoredRun.getRun().getRawTime().add(conePenaltySeconds); scoredRun.setRawTimeScored(rawTimeScored); } }
RawTimeScoringInteractor { public void score(ScoredRun scoredRun) { BigDecimal eventConePenaltySeconds = scoredRun.getRun().getEvent().getConePenaltySeconds(); BigDecimal runCones = BigDecimal.valueOf(scoredRun.getRun().getCones()); BigDecimal conePenaltySeconds = eventConePenaltySeconds.multiply(runCones); BigDecimal rawTimeScored = scoredRun.getRun().getRawTime().add(conePenaltySeconds); scoredRun.setRawTimeScored(rawTimeScored); } @Inject  RawTimeScoringInteractor(); }
RawTimeScoringInteractor { public void score(ScoredRun scoredRun) { BigDecimal eventConePenaltySeconds = scoredRun.getRun().getEvent().getConePenaltySeconds(); BigDecimal runCones = BigDecimal.valueOf(scoredRun.getRun().getCones()); BigDecimal conePenaltySeconds = eventConePenaltySeconds.multiply(runCones); BigDecimal rawTimeScored = scoredRun.getRun().getRawTime().add(conePenaltySeconds); scoredRun.setRawTimeScored(rawTimeScored); } @Inject  RawTimeScoringInteractor(); void score(ScoredRun scoredRun); }
RawTimeScoringInteractor { public void score(ScoredRun scoredRun) { BigDecimal eventConePenaltySeconds = scoredRun.getRun().getEvent().getConePenaltySeconds(); BigDecimal runCones = BigDecimal.valueOf(scoredRun.getRun().getCones()); BigDecimal conePenaltySeconds = eventConePenaltySeconds.multiply(runCones); BigDecimal rawTimeScored = scoredRun.getRun().getRawTime().add(conePenaltySeconds); scoredRun.setRawTimeScored(rawTimeScored); } @Inject  RawTimeScoringInteractor(); void score(ScoredRun scoredRun);  }