コード例 #1
0
        public void TestDistanceBetweenNodes(string input, string from, string to, int expectedOutput)
        {
            var orbitRelations = InputParser <(string, string)> .SplitAndParse(input, Solver.ParseOrbitRelation);

            var orbitTree = OrbitTreeBuilder.MakeTrees(orbitRelations)[0];

            Assert.AreEqual(expectedOutput, orbitTree.DistanceBetweenNodes(from, to));
        }
コード例 #2
0
        public void TestIndirectOrbits(string input, int expectedOutput)
        {
            var orbitRelations = InputParser <(string, string)> .SplitAndParse(input, Solver.ParseOrbitRelation);

            var orbitTree = OrbitTreeBuilder.MakeTrees(orbitRelations)[0];

            Assert.AreEqual(expectedOutput, orbitTree.CountAllOrbits());
        }