Package de.gamobi.jkariam.tests

Source Code of de.gamobi.jkariam.tests.CityTest

package de.gamobi.jkariam.tests;

import static org.junit.Assert.*;

import java.io.File;
import java.io.IOException;

import org.jdom.JDOMException;
import org.junit.Test;

import de.gamobi.jkariam.core.City;

public class CityTest {
 
  @Test
  public void loadAttributeTest() throws JDOMException, IOException {
    File cityFile = new File("tests" + File.separator + "00 - Testcity.xml");
    City city = new City(cityFile, true);
    city.loadAttributes();
   
    assertEquals("00", city.getId());
    assertEquals("Test City", city.getName());
    assertEquals(01, city.getPosition().getxPosition());
    assertEquals(99, city.getPosition().getyPosition());
    assertEquals(3322, city.getTotalPopulation());
    assertEquals(723, city.getWorker());
    assertEquals(735, city.getMiner());
    assertEquals(134, city.getScientists());
    assertEquals(0, city.getPriests());
  }

  @Test
  public void loadBuildingsTest() throws JDOMException, IOException {
    File cityFile = new File("tests" + File.separator + "00 - Testcity.xml");
    City city = new City(cityFile, true);
    city.loadBuildings();
   
    assertEquals(27, city.getBuildings().size());
    assertEquals("Akademie", city.getBuildings().get(0).getName());
    assertEquals("Zimmerei", city.getBuildings().get(26).getName());
  }
 
  @Test
  public void saveBuildingsTest() {
   
  }
}
TOP

Related Classes of de.gamobi.jkariam.tests.CityTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.