示例#1
0
        public void BaseCases(string path1, string path2, int expectedDistance)
        {
            List <string> moves1 = path1.Split(',').Select(x => x.Trim()).ToList();
            List <string> moves2 = path2.Split(',').Select(x => x.Trim()).ToList();
            int           steps  = WirePathCalculator.FindIntersectionWithShortestNumberOfSteps(moves1, moves2);

            Assert.Equal(expectedDistance, steps);
        }
示例#2
0
        public void Part2Answers()
        {
            List <string> moves1 = puzzleInputPath1.Split(',').Select(x => x.Trim()).ToList();
            List <string> moves2 = puzzleInputPath2.Split(',').Select(x => x.Trim()).ToList();
            int           steps  = WirePathCalculator.FindIntersectionWithShortestNumberOfSteps(moves1, moves2);

            int expectedSteps = 122514;

            Assert.Equal(expectedSteps, steps);
        }