示例#1
0
        public void WithAcceptsEmptyAction()
        {
            var dot =
                DotGraphBuilder.UndirectedGraph("G")
                .AddNode("node").With(c => { })
                .AddEdge("a", "b").With(c => { })
                .Build();

            AssertAreSame("graph G { node; a -- b }", dot);
        }
示例#2
0
        public void EdgesBeforeNodes()
        {
            var dot =
                DotGraphBuilder
                .UndirectedGraph("G")
                .AddEdge("a", "b").With(e => e.Weight(3.14))
                .AddNode("b").With(a => a.Shape(NodeShape.Box))
                .Build();

            AssertAreSame("graph G { b [shape=box]; a -- b [weight=3.14] }", dot);
        }
示例#3
0
        public void JustEdgesWithAttributes()
        {
            var dot =
                DotGraphBuilder
                .UndirectedGraph("G")
                .AddEdge("a", "b").With(a => a.Label("ab").FontSize(12).Color("black"))
                .AddEdge("a", "x")
                .AddEdge("x", "y").With(a => a.Weight(2).Color("red"))
                .Build();

            AssertAreSame(@"graph G { 
a -- b [color=black; fontsize=12; label=ab]; a -- x; x -- y [color=red; weight=2] }", dot);
        }
示例#4
0
        public void EmptyUndirectedGraph()
        {
            var dot = DotGraphBuilder.UndirectedGraph("EmptyGraph").Build();

            AssertAreSame("graph EmptyGraph { }", dot);
        }