コード例 #1
0
  @Test
  public void testDeclareWar_BranchCoverage() {

    Civilization enemy = this.getCivilizationConstructor("YOU");
    civ.declareWar(enemy);
    assertTrue(civ.getEnemies().contains(enemy.getName()));

    // it is impossible to get 100% branch coverage here because there is no way to
    // make an ally
  }
コード例 #2
0
 @Test
 public void testGettersAndSetters_BranchCoverage() {
   assertTrue(civ.getAllies().isEmpty());
   assertTrue(civ.getEnemies().isEmpty());
   assertTrue(civ.getknownCivs().isEmpty());
   civ.getName();
   assertTrue(civ.getPop() == 100);
   civ.getRace().getName();
   assertTrue(civ.getType().isEmpty());
   civ.setName("DKSFJKLDS");
 }