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

Method testRemoveConnections

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

Test of removeConnections method, of class Place.

()

Source from the content-addressed store, hash-verified

848 * Test of removeConnections method, of class Place.
849 */
850 @Test
851 public void testRemoveConnections() {
852 System.out.println("removeConnections");
853
854 Place instance = new Place("MyPlace", 1, 1, layer);
855 Place p1 = new Place("MyPlace", 0, 0, layer);
856 Place p2 = new Place("Another Place", -1, 2, layer);
857 Place p3 = new Place("Another Place", 1, 2, layer);
858
859 p2.connectChild(instance);
860 instance.connectChild(p3);
861 instance.connectPath(new Path(instance, "n", p2, "s"));
862
863 assertEquals(1, instance.getChildren().size());
864 assertEquals(1, instance.getParents().size());
865 assertEquals(1, instance.getPaths().size());
866
867 instance.removeConnections();
868
869 assertEquals(0, instance.getChildren().size());
870 assertEquals(0, instance.getParents().size());
871 assertEquals(0, instance.getPaths().size());
872 }
873
874 /**
875 * Test of matchKeywords method, of class Place.

Callers

nothing calls this directly

Calls 6

connectChildMethod · 0.95
connectPathMethod · 0.95
getChildrenMethod · 0.95
getParentsMethod · 0.95
getPathsMethod · 0.95
removeConnectionsMethod · 0.95

Tested by

no test coverage detected