Test of getPathTo method, of class Place.
()
| 593 | * Test of getPathTo method, of class Place. |
| 594 | */ |
| 595 | @Test |
| 596 | public void testGetPathTo() { |
| 597 | System.out.println("getPathTo"); |
| 598 | |
| 599 | Place instance = new Place("MyPlace", 1, 1, layer); |
| 600 | Place place = new Place("Another place", 1, 2, layer); |
| 601 | |
| 602 | Path p1 = new Path(instance, "n", place, "s"); |
| 603 | Path p2 = new Path(place, "e", instance, "w"); |
| 604 | instance.connectPath(p1); |
| 605 | instance.connectPath(p2); |
| 606 | |
| 607 | HashSet<Path> result = instance.getPathsTo("ne"); |
| 608 | assertTrue(result.isEmpty()); |
| 609 | |
| 610 | result = instance.getPathsTo("n"); |
| 611 | assertFalse(result.isEmpty()); |
| 612 | assertTrue(result.contains(p1)); |
| 613 | |
| 614 | result = instance.getPathsTo("w"); |
| 615 | assertFalse(result.isEmpty()); |
| 616 | assertTrue(result.contains(p2)); |
| 617 | } |
| 618 | |
| 619 | /** |
| 620 | * Test of getFlag method, of class Place. |
nothing calls this directly
no test coverage detected