Added a small test for the timer function

-More needed once scaling is in effect

#test #story[16]
This commit is contained in:
Erika Savell
2017-03-23 13:41:14 +13:00
parent 1c6bed7f37
commit 4c82a4594e
2 changed files with 19 additions and 5 deletions
+12
View File
@@ -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);
}
}