Exemplo n.º 1
0
        public void Walk()
        {
            string targetProject = "A";
            IDictionary <string, SortedSet <string> > dependencyGraph = DotGraph.LoadDependencyGraph(@"S:\GitHub\MsBuildProjectReferenceDependencyGraph\ProcessDependencyGraph\ProcessDependencyGraph.Tests\IdentifyDirectDependencyCountsTests\TestCase1.g");

            (Dictionary <string, string> ColoringDictionary, Dictionary <string, SortedSet <string> > UniqueProjectsForDependency)expected =
                (
                    new Dictionary <string, string>()
            {
                { "B", "#336699" }, { "C", "#99CCFF" }, { "E", "#336699" }, { "F", "#336699" }, { "D", "#99CCFF" }
            },
                    new Dictionary <string, SortedSet <string> >()
            {
                { "B", new SortedSet <string>()
                  {
                      "E", "F"
                  } }, { "C", new SortedSet <string>()
                         {
                             "D"
                         } }
            }
                );

            (Dictionary <string, string> ColoringDictionary, Dictionary <string, SortedSet <string> > UniqueProjectsForDependency)actual =
                IdentifyDirectDependencyCounts.Walk(targetProject, dependencyGraph);

            Assert.That(actual, Is.EqualTo(expected));
        }
        public void Walk()
        {
            string targetProject = "A";
            IDictionary <string, SortedSet <string> > dependencyGraph = DotGraph.LoadDependencyGraph(Path.Combine(TestContext.CurrentContext.TestDirectory, "IdentifyDirectDependencyCountsTests", "TestCase1.g"));

            (Dictionary <string, string> ColoringDictionary, Dictionary <string, SortedSet <string> > UniqueProjectsForDependency)expected =
                (
                    new Dictionary <string, string>()
            {
                { "B", "#336699" }, { "C", "#99CCFF" }, { "E", "#336699" }, { "F", "#336699" }, { "D", "#99CCFF" }
            },
                    new Dictionary <string, SortedSet <string> >()
            {
                { "B", new SortedSet <string>()
                  {
                      "E", "F"
                  } }, { "C", new SortedSet <string>()
                         {
                             "D"
                         } }
            }
                );

            (Dictionary <string, string> ColoringDictionary, Dictionary <string, SortedSet <string> > UniqueProjectsForDependency)actual =
                IdentifyDirectDependencyCounts.Walk(targetProject, dependencyGraph);

            Assert.That(actual, Is.EqualTo(expected));
        }
Exemplo n.º 3
0
        public void Execute(string targetProject, IDictionary <string, SortedSet <string> > dependencyGraph, string expected)
        {
            string actual = IdentifyDirectDependencyCounts.Execute(targetProject, dependencyGraph);

            Assert.That(actual, Is.EqualTo(expected));
        }