public void TestAddVertex_WithExistingID() { GraphWirth a = new GraphWirth(); bool expected = false; a.AddVertex(15); bool actual = a.AddVertex(15); Assert.AreEqual(expected, actual, "Vertex with this key is already exists."); }
public void TestDeleteVertex() { GraphWirth a = new GraphWirth(); bool expected = true; a.AddVertex(15, 20); a.AddVertex(20); bool actual = a.DeleteVertex(15); Assert.AreEqual(expected, actual, "Unable to delete vertex."); }
public void TestDeleteVertex_FirstOfMany() { GraphWirth a = new GraphWirth(); bool expected = true; a.AddVertex(10); a.AddVertex(100); a.AddVertex(1000); bool actual = a.DeleteVertex(1); Assert.AreEqual(expected, actual, "Error deleting first vertex."); }
public void TestDeleteVertex_LastVertex() { GraphWirth a = new GraphWirth(); bool expected = true; a.AddVertex(10); a.AddVertex(100); a.AddVertex(15, 1000); bool actual = a.DeleteVertex(15); Assert.AreEqual(expected, actual, "Error deleting last vertex."); }
public void TestAddVertex() { GraphWirth a = new GraphWirth(); bool expected = true; bool actual = a.AddVertex(15); Assert.AreEqual(expected, actual, "Error adding vertex."); }
public void TestAddDirectEdge() { GraphWirth a = new GraphWirth(); bool expected = true; a.AddVertex(0); bool actual = a.AddDirectEdge(1, 2, 0); Assert.AreEqual(expected, actual, "Error adding direct edge."); }
public void TestDeleteUndirectEdge_ToFrom() { GraphWirth a = new GraphWirth(); bool expected = true; a.AddVertex(0); a.AddDirectEdge(1, 2, 0); bool actual = a.DeleteDirectEdge(2, 1); Assert.AreEqual(expected, actual, "Error deleting undirect edge."); }
public void TestDeleteDirectEdge_ToFrom() { GraphWirth a = new GraphWirth(); bool expected = false; a.AddVertex(0); a.AddDirectEdge(1, 2, 0); bool actual = a.DeleteDirectEdge(2, 1); Assert.AreEqual(expected, actual, "Incorrect order of vertexes while deleting direct edge."); }
public void AddVertex(string info = "") { graph.AddVertex(vertexes.Count + 1, info); VisualiseGraph(); }