MCPcopy Create free account
hub / github.com/Neop/mudmap2 / testGetPathTo

Method testGetPathTo

src/test/java/mudmap2/backend/PlaceTest.java:595–617  ·  view source on GitHub ↗

Test of getPathTo method, of class Place.

()

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 4

connectPathMethod · 0.95
getPathsToMethod · 0.95
isEmptyMethod · 0.65
containsMethod · 0.65

Tested by

no test coverage detected