本文整理汇总了C#中Vertex.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Vertex.ToString方法的具体用法?C# Vertex.ToString怎么用?C# Vertex.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vertex
的用法示例。
在下文中一共展示了Vertex.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VertexWithTwoNeighboursToStringTest
public void VertexWithTwoNeighboursToStringTest()
{
var v1 = new Vertex(1);
var v2 = new Vertex(2);
var v3 = new Vertex(3);
v1.AddDoublyLinkedNeighbour(v2);
v1.AddDoublyLinkedNeighbour(v3);
Assert.AreEqual("1 : 2, 3", v1.ToString());
Assert.AreEqual("2 : 1", v2.ToString());
Assert.AreEqual("3 : 1", v3.ToString());
}
示例2: btnInitVertices_Click
private void btnInitVertices_Click(object sender, EventArgs e)
{
vertices = new List<Vertex>();
edges = new List<Edge>();
tbVertices.Clear();
tbEdges.Clear();
for(int i = 1; i <= numVerticesSum.Value; i++)
{
Vertex newVertex = new Vertex(i, 0);
vertices.Add(newVertex);
tbVertices.AppendText(newVertex.ToString() + "\r\n");
}
btnAddEge.Enabled = true;
btnCreateGraph.Enabled = true;
tbRegularExpression.Enabled = true;
numInitVertex.Enabled = true;
numFinalVertex.Enabled = true;
numStartGraphVertex.Enabled = true;
numFinishGraphVertex.Enabled = true;
numInitVertex.Maximum = numVerticesSum.Value;
numFinalVertex.Maximum = numVerticesSum.Value;
numStartGraphVertex.Maximum = numVerticesSum.Value;
numFinishGraphVertex.Maximum = numVerticesSum.Value;
numStartGraphVertex.Value = 1;
numFinishGraphVertex.Value = numVerticesSum.Value;
}
示例3: VertexWithoutNeighboursToStringTest
public void VertexWithoutNeighboursToStringTest()
{
var v = new Vertex(1);
Assert.AreEqual("1 : ", v.ToString());
}
示例4: TestToString
public void TestToString()
{
var vertex = new Vertex(12.34f, -98.7f, 54);
Assert.Equal("[12.34, -98.7, 54]", vertex.ToString());
}