Test of getYMax method, of class Layer.
()
| 349 | * Test of getYMax method, of class Layer. |
| 350 | */ |
| 351 | @Test |
| 352 | public void testGetYMax() { |
| 353 | System.out.println("getYMax"); |
| 354 | |
| 355 | Layer instance = new Layer(world); |
| 356 | |
| 357 | // no place in layer |
| 358 | assertEquals(0, instance.getYMax()); |
| 359 | |
| 360 | // two places in layer |
| 361 | try { |
| 362 | instance.put(new Place("MyPlace", 3, 5, instance)); |
| 363 | instance.put(new Place("MyPlace", -6, -8, instance)); |
| 364 | |
| 365 | int expResult = 5; |
| 366 | int result = instance.getYMax(); |
| 367 | assertEquals(expResult, result); |
| 368 | } catch (Layer.PlaceNotInsertedException ex) { |
| 369 | Logger.getLogger(LayerTest.class.getName()).log(Level.SEVERE, null, ex); |
| 370 | fail(ex.getMessage()); |
| 371 | } |
| 372 | } |
| 373 | |
| 374 | /** |
| 375 | * Test of putPlace method, of class Layer. |