@Test public void mergeZones() { Item item = new Item(); item.setName("Battery"); List<Item> items = new ArrayList<Item>(); items.add(item); Zone genericZone = createZone( 0, 0, ZoneDanger.ONE_TO_THREE, -1, -1, false, false, false, false, null, null, null, null, 0); Zone specificZone = createZone( 0, 0, ZoneDanger.NONE, 2, 5, true, true, true, true, items, "Huge Well", "2011-08-04 12:30:15", "Fred", 8); genericZone.mergeZone(specificZone, 8); assertEquals(true, genericZone.isVisited()); assertEquals(2, genericZone.getZombies()); assertEquals(5, genericZone.getScoutSense()); assertEquals(true, genericZone.isBluePrintRetrieved()); assertEquals(true, genericZone.isBuildingDepleted()); assertEquals(true, genericZone.isZoneDepleted()); assertEquals(1, genericZone.getItems().size()); assertEquals("Huge Well", genericZone.getScoutPeek()); }
@Test public void constructorTest() { Zone zone = new ZoneBuilder() .setX(-10) .setY(5) .setZoneDepleted(true) .setBuildingDepleted(true) .setBluePrintRetrieved(true) .setScoutPeek("Rolly's Rotor House") .setCampingTopology(CampingTopology.L2_SHORTAGE) .setZombies(19) .toZone(); assertEquals(-10, zone.getX()); assertEquals(5, zone.getY()); assertEquals(true, zone.isBluePrintRetrieved()); assertEquals(true, zone.isZoneDepleted()); assertEquals(true, zone.isBuildingDepleted()); assertEquals(CampingTopology.L2_SHORTAGE, zone.getCampingTopology()); assertEquals("Rolly's Rotor House", zone.getScoutPeek()); assertEquals(19, zone.getZombies()); }