Test of getXMin method, of class Layer.
()
| 271 | * Test of getXMin method, of class Layer. |
| 272 | */ |
| 273 | @Test |
| 274 | public void testGetXMin() { |
| 275 | System.out.println("getXMin"); |
| 276 | |
| 277 | Layer instance = new Layer(world); |
| 278 | |
| 279 | // no place in layer |
| 280 | assertEquals(0, instance.getXMin()); |
| 281 | |
| 282 | // two places in layer |
| 283 | try { |
| 284 | instance.put(new Place("MyPlace", 3, 5, instance)); |
| 285 | instance.put(new Place("MyPlace", -6, -8, instance)); |
| 286 | |
| 287 | int expResult = -6; |
| 288 | int result = instance.getXMin(); |
| 289 | assertEquals(expResult, result); |
| 290 | } catch (Layer.PlaceNotInsertedException ex) { |
| 291 | Logger.getLogger(LayerTest.class.getName()).log(Level.SEVERE, null, ex); |
| 292 | fail(ex.getMessage()); |
| 293 | } |
| 294 | } |
| 295 | |
| 296 | /** |
| 297 | * Test of getXMax method, of class Layer. |