Exemplo n.º 1
0
 @Test
 public void deleteCityInfo() throws CityInfoNotFoundException {
   CityInfo cf = new CityInfo();
   cf.setZipCode("10");
   cf.setCity("Silvermoon City");
   test.createCityInfo(cf);
   assertNotNull(test.getCityByZipCode("10"));
   test.deleteCityInfo(cf);
 }
Exemplo n.º 2
0
  @Test
  public void getAllCityInfoes() throws CityInfoNotFoundException {
    CityInfo cf1 = new CityInfo();
    cf1.setZipCode("3");
    cf1.setCity("Dragør");
    test.createCityInfo(cf1);
    CityInfo cf2 = new CityInfo();
    cf2.setZipCode("4");
    cf2.setCity("Tårnby");
    test.createCityInfo(cf2);
    CityInfo cf3 = new CityInfo();
    cf3.setZipCode("5");
    cf3.setCity("Ironforge");
    test.createCityInfo(cf3);
    CityInfo cf4 = new CityInfo();
    cf4.setZipCode("6");
    cf4.setCity("Silvermoon City");
    test.createCityInfo(cf4);

    List<CityInfo> cfl = test.getAllCityInfoes();
    assertTrue(cfl.size() == 5);
    test.deleteCityInfo(cf1);
    test.deleteCityInfo(cf2);
    test.deleteCityInfo(cf3);
    test.deleteCityInfo(cf4);
  }
Exemplo n.º 3
0
  @Test
  public void updateCityInfo() throws CityInfoNotFoundException {
    CityInfo cf = new CityInfo();
    cf.setZipCode("8");
    cf.setCity("Silvermoon City");
    test.createCityInfo(cf);
    System.out.println(cf.getZipCode());
    assertEquals(test.getCityByZipCode(cf.getZipCode()).getCity(), "Silvermoon City");

    CityInfo cfUpd = test.getCityByZipCode(cf.getZipCode());
    cfUpd.setCity("Ironforge");
    test.updateCityInfo(cfUpd);
    System.out.println(cfUpd.getZipCode() + cf.getZipCode());
    assertEquals(test.getCityByZipCode(cf.getZipCode()).getCity(), "Ironforge");
    test.deleteCityInfo(cf);
  }
Exemplo n.º 4
0
 @Test
 public void testGetCityInformation() {
   CityInfo cityinfo = cf.getCityInformation(2700);
   Assert.assertNotNull(cityinfo.getzipCode());
 }