public void WithAcceptsEmptyAction() { var dot = DotGraphBuilder.NondirectedGraph("G") .AddNode("node").With(c => { }) .AddEdge("a", "b").With(c => { }) .Build(); AssertAreSame("graph G { node; a -- b }", dot); }
public void NodesAreBeforeEdges() { var dot = DotGraphBuilder .NondirectedGraph("G") .AddEdge("a", "b") .AddNode("b").With(a => a.Shape(NodeShape.Box)) .Build(); AssertAreSame("graph G { b [shape=box]; a -- b }", dot); }
public void JustEdgesWithAttributes() { var dot = DotGraphBuilder .NondirectedGraph("G") .AddEdge("a", "b").With(a => a.Label("ab").FontSize(12).Color("black")) .AddEdge("a", "x") .AddEdge("x", "y").With(a => a.Weight(2)) .Build(); AssertAreSame(@"graph G { a -- b [color=black; fontsize=12; label=ab]; a -- x; x -- y [weight=2] }", dot); }
public void EmptyNondirecterGraph() { var dot = DotGraphBuilder.NondirectedGraph("EmptyGraph").Build(); AssertAreSame("graph EmptyGraph { }", dot); }