public void VertexAdded_ReturnTrueName() { var vertex1 = new VertexOfTable("sample", new List <string>()); var vertex2 = new VertexOfTable("sample1", new List <string>()); var graph = new Graph(); graph.AddVertexIfNonExist(vertex1); var id = graph.GetIdOfVertex(vertex1.GetName()); Assert.Equal(vertex1.GetName(), graph.GetNameOfTableById(id)); }
public void NoEdgeForVertex_ReturnEmptyList() { var vertex1 = new VertexOfTable("sample", new List <string>()); var vertex2 = new VertexOfTable("sample1", new List <string>()); var graph = new Graph(); graph.AddVertexIfNonExist(vertex1); graph.AddVertexIfNonExist(vertex2); Assert.Equal(new List <Edge> (), graph.GetEdgesByVertexId(graph.GetIdOfVertex(vertex1.GetName()))); }