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)); }
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()); }