Added a small test for the timer function
-More needed once scaling is in effect #test #story[16]
This commit is contained in:
@@ -98,4 +98,16 @@ public class RaceTest {
|
||||
assertTrue(unFinishedBoat.getDistanceTravelledInLeg() < 100);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void timerDelaysByHalfSecond() {
|
||||
ConstantVelocityRace race = new ConstantVelocityRace(new BoatInRace[1], new ArrayList<>());
|
||||
race.PRERACE_TIME = 500;
|
||||
|
||||
long timeStarted = System.currentTimeMillis();
|
||||
race.countdownTimer();
|
||||
|
||||
assertTrue(System.currentTimeMillis() - timeStarted > 500);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user