Simulator/test/model/map/MapTest.java
/**
	 * Tests the adding and removing of items on the map.
	 */
Tests the adding and removing of items on the map.
Tests the adding and removing of items on the map .
@Test
	public void testAddAndRemove() {
		Map m = new Map();
		Wall w = new Wall(10, 10, 0.1, 0.1);
		m.add(w);
		Assert.assertTrue(m.getMapComponents(Wall.class).size() == 1);
		Assert.assertTrue(m.getMapComponents(PhysicalObject.class).size() == 1);
		Assert.assertTrue(m.getMapComponents(MapComponent.class).size() == 1);
		QueueSeparator q = new QueueSeparator(1, 1, 0.1, 0.1);
		m.add(q);
		Assert.assertTrue(m.getMapComponents(Wall.class).size() == 1);
		Assert.assertTrue(m.getMapComponents(QueueSeparator.class).size() == 1);
		Assert.assertTrue(m.getMapComponents(PhysicalObject.class).size() == 2);
		Assert.assertTrue(m.getMapComponents(MapComponent.class).size() == 2);
		m.remove(w);
		Assert.assertTrue(w.isDestroyed());
		Assert.assertTrue(m.getMapComponents(Wall.class).size() == 0);
		Assert.assertTrue(m.getMapComponents(PhysicalObject.class).size() == 1);
		Assert.assertTrue(m.getMapComponents(MapComponent.class).size() == 1);
	}
@ Test public void testAddAndRemove ( ) { Map m = new Map ( ) ; Wall w = new Wall ( 10 , 10 , 0.1 , 0.1 ) ; m . add ( w ) ; Assert . assertTrue ( m . getMapComponents ( Wall . class ) . size ( ) == 1 ) ; Assert . assertTrue ( m . getMapComponents ( PhysicalObject . class ) . size ( ) == 1 ) ; Assert . assertTrue ( m . getMapComponents ( MapComponent . class ) . size ( ) == 1 ) ; QueueSeparator q = new QueueSeparator ( 1 , 1 , 0.1 , 0.1 ) ; m . add ( q ) ; Assert . assertTrue ( m . getMapComponents ( Wall . class ) . size ( ) == 1 ) ; Assert . assertTrue ( m . getMapComponents ( QueueSeparator . class ) . size ( ) == 1 ) ; Assert . assertTrue ( m . getMapComponents ( PhysicalObject . class ) . size ( ) == 2 ) ; Assert . assertTrue ( m . getMapComponents ( MapComponent . class ) . size ( ) == 2 ) ; m . remove ( w ) ; Assert . assertTrue ( w . isDestroyed ( ) ) ; Assert . assertTrue ( m . getMapComponents ( Wall . class ) . size ( ) == 0 ) ; Assert . assertTrue ( m . getMapComponents ( PhysicalObject . class ) . size ( ) == 1 ) ; Assert . assertTrue ( m . getMapComponents ( MapComponent . class ) . size ( ) == 1 ) ; }
Tests the adding and removing of items on the map.
Tests the adding and removing of items on the map .