コード例 #1
0
  /** Tests the constructors. */
  @Test
  public void testConstructors() {
    assertNotNull("Default RacingAthlete is null", defaultAthlete);

    assertEquals("Specific RacingAthlete: Name not matching", _name, specificAthlete.getName());

    assertEquals("Specific RacingAthlete: Age not matching", _age, specificAthlete.getAge());

    assertEquals(
        "Specific RacingAthlete: Contestant ID not matching",
        _id,
        specificAthlete.getContestantID());
  }
コード例 #2
0
  /** Person: Test the age setter/getter. */
  @Test
  public void testSetGetAge() {
    defaultAthlete.setAge(_defaultAge);

    assertEquals("Age is not set properly", _defaultAge, defaultAthlete.getAge());
  }