public string SerializeGraphAsDotString() { DotGraph gr = DotGraphConverter.ToDot(GraphArea.ToGraph()); string dot = DotFileGenerator.Serialize(gr); return(dot); }
public void BifrostToDotGraphSingleNode() { Graph g = new Graph(); g.AddNode(new Node("054b46d7-6b2e-46a6-a7c3-16a31c9e1a53", "alpha")); DotGraph dot = DotGraphConverter.ToDot(g); assertDotContainsNode(dot, "054b46d7-6b2e-46a6-a7c3-16a31c9e1a53", "alpha"); }
public void BifrostToDotGraphSingleEdge() { Graph g = new Graph(); g.AddNode(new Node("id1", "beta")); g.AddNode(new Node("id2", "theta")); g.AddEdge(new Edge("id1", "id2")); DotGraph dot = DotGraphConverter.ToDot(g); assertDotContainsNode(dot, "id1", "beta"); assertDotContainsNode(dot, "id2", "theta"); Assert.Contains(("id1", "id2"), dot.Edges); }
public void BifrostToDotGraphDuplicatedNodeKey() { Graph g = new Graph(); g.AddNode(new Node("id1", "beta")); g.AddNode(new Node("id2", "theta")); g.AddNode(new Node("id1", "gamma")); DotGraph dot = DotGraphConverter.ToDot(g); assertDotContainsNode(dot, "id1", "beta"); assertDotContainsNode(dot, "id2", "theta"); assertDotContainsNode(dot, "id10", "gamma"); Assert.Equal(3, dot.Nodes.Count); }