コード例 #1
0
 public void GeneratesXDocument()
 {
     DirectedGraph graph = new DirectedGraph();
     graph.Nodes = new[] { new DirectedGraphNode(), };
     var document = graph.AsXDocument();
     Assert.Equal(1, document.Root.Elements().Count());
 }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PackageUpgradeVisualizer"/> class.
        /// </summary>
        /// <param name="directedGraph">The directed graph used to visualize package upgrades.</param>
        /// <param name="palette">The color palette to color nodes and links.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="directedGraph"/> is <c>null</c>.
        /// - or -
        /// <paramref name="palette"/> is <c>null</c>.
        /// </exception>
        public PackageUpgradeVisualizer(DirectedGraph directedGraph, PackageUpgradePalette palette)
        {
            if (directedGraph == null)
            {
                throw new ArgumentNullException(nameof(directedGraph));
            }
            if (palette == null)
            {
                throw new ArgumentNullException(nameof(palette));
            }

            _directedGraph = directedGraph;
            _palette = palette;
        }
コード例 #3
0
 public Visualize()
 {
     _directedGraph = new DirectedGraph();
     _visualizer = new PackageUpgradeVisualizer(_directedGraph);
 }
コード例 #4
0
 public void ThrowsOnNullPackageUpgradePalette()
 {
     var directedGraph = new DirectedGraph();
     Assert.Throws<ArgumentNullException>("palette", () => new PackageUpgradeVisualizer(directedGraph, null));
 }
コード例 #5
0
 public CreateDependencyGraph()
 {
     _directedGraph = Factory.CreateDependencyGraph();
 }
コード例 #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PackageUpgradeVisualizer"/> class.
 /// </summary>
 /// <param name="directedGraph">The directed graph used to visualize package upgrades.</param>
 /// <exception cref="ArgumentNullException"><paramref name="directedGraph"/> is <c>null</c>.</exception>
 public PackageUpgradeVisualizer(DirectedGraph directedGraph)
     : this(directedGraph, new PackageUpgradePalette())
 {
 }