Test of getXMax method, of class Layer.
()
| 297 | * Test of getXMax method, of class Layer. |
| 298 | */ |
| 299 | @Test |
| 300 | public void testGetXMax() { |
| 301 | System.out.println("getXMax"); |
| 302 | |
| 303 | Layer instance = new Layer(world); |
| 304 | |
| 305 | // no place in layer |
| 306 | assertEquals(0, instance.getXMax()); |
| 307 | |
| 308 | // two places in layer |
| 309 | try { |
| 310 | instance.put(new Place("MyPlace", 3, 5, instance)); |
| 311 | instance.put(new Place("MyPlace", -6, -8, instance)); |
| 312 | |
| 313 | int expResult = 3; |
| 314 | int result = instance.getXMax(); |
| 315 | assertEquals(expResult, result); |
| 316 | } catch (Layer.PlaceNotInsertedException ex) { |
| 317 | Logger.getLogger(LayerTest.class.getName()).log(Level.SEVERE, null, ex); |
| 318 | fail(ex.getMessage()); |
| 319 | } |
| 320 | } |
| 321 | |
| 322 | /** |
| 323 | * Test of getYMin method, of class Layer. |