@Test public void itShouldSetRawTimeScoredForConedRun() { BigDecimal rawTime = BigDecimal.valueOf(100.000D); when(run.getRawTime()).thenReturn(rawTime); when(run.getCones()).thenReturn(3); BigDecimal expected = BigDecimal.valueOf(106.000D); interactor.score(scoredRun); verify(scoredRun).setRawTimeScored(eq(expected)); }
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);  }