Test of isEmpty method, of class Layer.
()
| 760 | * Test of isEmpty method, of class Layer. |
| 761 | */ |
| 762 | @Test |
| 763 | public void testIsEmpty() { |
| 764 | System.out.println("isEmpty"); |
| 765 | |
| 766 | Layer instance = new Layer(world); |
| 767 | // empty layer |
| 768 | assertTrue(instance.isEmpty()); |
| 769 | |
| 770 | try { |
| 771 | Place element = new Place("MyPlace", 0, 0, instance); |
| 772 | instance.put(element); |
| 773 | // layer has one place |
| 774 | assertFalse(instance.isEmpty()); |
| 775 | |
| 776 | instance.remove(element); |
| 777 | // empty layer |
| 778 | assertTrue(instance.isEmpty()); |
| 779 | } catch (RuntimeException | Layer.PlaceNotInsertedException ex) { |
| 780 | fail(ex.getMessage()); |
| 781 | } |
| 782 | |
| 783 | } |
| 784 | |
| 785 | /** |
| 786 | * Test of getPlaces method, of class Layer. |