public void TestAdjacencyListNoDuplication() { GameObject space1 = SpacesTest.CreateBlueSpace(); GameObject space2 = SpacesTest.CreateBlueSpace(); GameObject edge = CreateEdge(space1, space2); AbstractSpace as1 = space1.GetComponent <AbstractSpace>(); Assert.IsTrue(as1.IncidentEdges.Count == 1); }
public void TestAdjacencyList() { GameObject space1 = SpacesTest.CreateBlueSpace(); GameObject space2 = SpacesTest.CreateBlueSpace(); GameObject edge = CreateEdge(space1, space2); AbstractSpace as1 = space1.GetComponent <AbstractSpace>(); AbstractSpace as2 = space2.GetComponent <AbstractSpace>(); Assert.IsTrue(as1.IncidentEdges.Contains(edge)); Assert.IsTrue(as2.IncidentEdges.Contains(edge)); }
public void TestCantOverwriteNodesInEdge() { GameObject space1 = SpacesTest.CreateBlueSpace(); GameObject space2 = SpacesTest.CreateBlueSpace(); GameObject edge = CreateEdge(space1, space2); Edge edgeComponent = edge.GetComponent <Edge>(); Assert.IsTrue(edgeComponent.Source == space1); Assert.IsTrue(edgeComponent.Destination == space2); edgeComponent.Source = space2; edgeComponent.Destination = space1; Assert.IsTrue(edgeComponent.Source == space1); Assert.IsTrue(edgeComponent.Destination == space2); }