public void RenderFromInMemoryGraphToFile()
        {
            string outputFilePath = Path.Combine(Directory.GetCurrentDirectory(), "RenderFromInMemoryGraph.png");

            const string graph    = @"digraph G { node [style=filled, shape=rect]

# Nodes
""String age"" -> ""Int64.Parse()"" -> {""Int64"", ""Collector""}


# Formatting
""String age"" [color=green]
""Int64"" [color=""#9fbff4""]
""Int64.Parse()"" [shape=invhouse]
""Collector"" [color = ""#c361f4""]

{ rank=same; ""Int64.Parse()"", ""Collector""}


}";
            var          graphViz = new GraphViz();


            graphViz.LayoutAndRenderDotGraph(graph, outputFilePath, "png");

            Approvals.VerifyFile(outputFilePath);
        }
        public void RenderFromInMemoryGraph()
        {
            const string graph    = @"digraph G { node [style=filled, shape=rect]

# Nodes
""String age"" -> ""Int64.Parse()"" -> {""Int64"", ""Collector""}


# Formatting
""String age"" [color=green]
""Int64"" [color=""#9fbff4""]
""Int64.Parse()"" [shape=invhouse]
""Collector"" [color = ""#c361f4""]

{ rank=same; ""Int64.Parse()"", ""Collector""}


}";
            var          graphViz = new GraphViz();


            byte[] result = graphViz.LayoutAndRenderDotGraph(graph, "png");

            Approvals.VerifyBinaryFile(result, ".png");
        }
Esempio n. 3
0
        private static void VerifyAsRenderedGraph(IGraphNode input, string format)
        {
            var dotGraph = DotGraph.DotGraph.FromPipeline(input);
            var graphViz = new GraphViz();

            graphViz.Config.TreatWarningsAsErrors = true;

            var output = graphViz.LayoutAndRenderDotGraph(dotGraph.ToString(), format);

            Approvals.VerifyBinaryFile(output, "." + format);
        }