Test of getPlaces method, of class Layer.
()
| 786 | * Test of getPlaces method, of class Layer. |
| 787 | */ |
| 788 | @Test |
| 789 | public void testGetPlaces() { |
| 790 | System.out.println("getPlaces"); |
| 791 | |
| 792 | Layer instance = new Layer(world); |
| 793 | |
| 794 | HashSet<Place> result = instance.getPlaces(); |
| 795 | assertNotNull(result); |
| 796 | assertTrue(result.isEmpty()); |
| 797 | |
| 798 | Place el1 = new Place("Place1", 0, 0, instance); |
| 799 | Place el2 = new Place("Place2", -1, 2, instance); |
| 800 | try { |
| 801 | instance.put(el1); |
| 802 | instance.put(el2); |
| 803 | |
| 804 | result = instance.getPlaces(); |
| 805 | assertEquals(2, result.size()); |
| 806 | assertTrue(result.contains(el1)); |
| 807 | assertTrue(result.contains(el2)); |
| 808 | } catch (Layer.PlaceNotInsertedException ex) { |
| 809 | fail(ex.getMessage()); |
| 810 | } |
| 811 | } |
| 812 | |
| 813 | /** |
| 814 | * Test of toString method, of class Layer. |