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

Method testGetPaths_Place

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

Test of getPaths method, of class Place.

()

Source from the content-addressed store, hash-verified

422 * Test of getPaths method, of class Place.
423 */
424 @Test
425 public void testGetPaths_Place() {
426 System.out.println("getPaths");
427
428 Place instance = new Place("MyPlace", 1, 1, layer);
429 Place place1 = new Place("Another place", 1, 2, layer);
430
431 HashSet<Path> result1 = instance.getPaths(place1);
432 assertNotNull(result1);
433 assertTrue(result1.isEmpty());
434
435 Path p1 = new Path(instance, "n", place1, "s");
436 Path p2 = new Path(place1, "n", instance, "s");
437 instance.connectPath(p1);
438 instance.connectPath(p2);
439
440 HashSet<Path> result2 = instance.getPaths(place1);
441 assertEquals(2, result2.size());
442 assertTrue(result2.contains(p1));
443 assertTrue(result2.contains(p2));
444
445 HashSet<Path> result3 = instance.getPaths(null);
446 assertNotNull(result3);
447 assertTrue(result3.isEmpty());
448 }
449
450 /**
451 * Test of getPaths method, of class Place.

Callers

nothing calls this directly

Calls 4

getPathsMethod · 0.95
connectPathMethod · 0.95
isEmptyMethod · 0.65
containsMethod · 0.65

Tested by

no test coverage detected