/** Test the injury status getter/setter */ @Test public void testSetGetIsInjured() { boolean isInjured = true; defaultAthlete.setIsInjured(isInjured); assertEquals("Injury state was not set properly", isInjured, defaultAthlete.getIsInjured()); }
/** Ascertain that performRaceActivity() throws an AthleteInjuredException when injured. */ @Test(expected = AthleteInjuredException.class) public void testPerformRaceActivity_Throws_OnInjury() { defaultAthlete.setIsInjured(true); defaultAthlete.performRaceActivity(); }