Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        public void EmptyNondirecterGraph()
        {
            var dot = DotGraphBuilder.NondirectedGraph("EmptyGraph").Build();

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