public void GenerateDot() { var startNodes = Graph.Nodes.Where(x => !Graph.Nodes.Any(y => Graph.GetDependenciesForNode(y).Contains(x))); var endNodes = Graph.Nodes.Where(x => Graph.GetDependenciesForNode(x).Count() == 0); var circularReferences = CircularReferencesHelper.FindCircularReferences(Graph, startNodes, endNodes); var dotCommandBuilder = new DotCommandBuilder<ProjectInfo>(); var dotCommand = dotCommandBuilder.GenerateDotCommand(Graph, circularReferences, ""); Console.WriteLine(dotCommand); }
public void GenerateDotCommand() { var graph = new DependencyGraph<string>(); graph.AddDependency("A", "B"); var filterPreferences = new AssemblyFilterPreferences(); filterPreferences.SetAssemblyNames(graph.GetNodes()); var command = new DotCommandBuilder().GenerateDotCommand(graph, filterPreferences); const string expected = @"digraph G { 1 -> 2; 1 [label=""A""]; 2 [label=""B""]; }"; Assertion.AssertEquals(expected, command); }
public void GenerateDotCommand() { var graph = new DependencyGraph <string>(); graph.AddDependency("A", "B"); var filterPreferences = new AssemblyFilterPreferences(); filterPreferences.SetAssemblyNames(graph.Nodes); var command = DotCommandBuilder.Generate(graph, filterPreferences); const string expected = @"digraph G { 1 -> 2; 1 [label=""A""]; 2 [label=""B""]; }"; Assert.AreEqual(expected, command); }
public void GenerateDotCommand_ExclusionList() { var graph = new DependencyGraph <string>(); graph.AddDependency("A", "B"); graph.AddDependency("B", "C"); graph.AddDependency("C", "A"); var filterPreferences = new AssemblyFilterPreferences(); filterPreferences.SetAssemblyNames(graph.GetNodes()); filterPreferences.Exclude("C"); var command = new DotCommandBuilder().GenerateDotCommand(graph, filterPreferences); const string expected = @"digraph G { 1 -> 2; 1 [label=""A""]; 2 [label=""B""]; }"; Assertion.AssertEquals(expected, command); }