Test of getParents method, of class Place.
()
| 784 | * Test of getParents method, of class Place. |
| 785 | */ |
| 786 | @Test |
| 787 | public void testGetParents() { |
| 788 | System.out.println("getParents"); |
| 789 | |
| 790 | Layer layer2 = new Layer(world); |
| 791 | Layer layer3 = new Layer(world); |
| 792 | Place p1 = new Place("Child", 0, 0, layer2); |
| 793 | Place p2 = new Place("Child", 0, 0, layer3); |
| 794 | Place instance = new Place("MyPlace", 0, 0, layer); |
| 795 | |
| 796 | assertNotNull(instance.getParents()); |
| 797 | assertEquals(0, instance.getParents().size()); |
| 798 | |
| 799 | p1.connectChild(instance); |
| 800 | assertEquals(1, instance.getParents().size()); |
| 801 | assertTrue(instance.getParents().contains(p1)); |
| 802 | |
| 803 | p2.connectChild(instance); |
| 804 | assertEquals(2, instance.getParents().size()); |
| 805 | assertTrue(instance.getParents().contains(p1)); |
| 806 | assertTrue(instance.getParents().contains(p2)); |
| 807 | } |
| 808 | |
| 809 | /** |
| 810 | * Test of toString method, of class Place. |
nothing calls this directly
no test coverage detected