@Test public void testAddZone() { System.out.println("Testing addZone() method..."); System.out.print("\taddZone(null) must return false ..."); assertFalse(empty_bp.addZone(null)); System.out.println("OK"); System.out.print("\taddZone(zone) must return true..."); assertTrue(empty_bp.addZone(z1)); System.out.println("OK"); System.out.print("\taddZone(zone) must return true (multiple additions)..."); assertTrue(empty_bp.addZone(z2)); assertTrue(empty_bp.addZone(z3)); System.out.println("OK"); System.out.print("\tThe number of added zones are correct..."); assertEquals("Different elements", empty_bp.getZones().size(), 3); System.out.println("OK"); System.out.print("\tThe zones in the BorderPoint are the added ones..."); assertEquals("Different elements", empty_bp.getZones().get(0), z1); assertEquals("Different elements", empty_bp.getZones().get(1), z2); assertEquals("Different elements", empty_bp.getZones().get(2), z3); System.out.println("OK"); }
@Before public void setUp() throws Exception { c1 = new Country("country1"); z1 = new Zone(c1); z2 = new Zone(c1); z3 = new Zone(c1); empty_bp = new BorderPoint(1, 2); bp = new BorderPoint(1, 2, z1); bp.addZone(z2); bp.addZone(z3); }