Beispiel #1
0
        public void LongestPathIsCorrect(string passcode, int x, int y, int expected)
        {
            var sut    = new AdventOfCode2016.Day17.Day17(passcode);
            var actual = sut.LongestPath(x, y);

            Assert.Equal(expected, actual);
        }
Beispiel #2
0
        private static void Day17()
        {
            var d17 = new Day17.Day17("udskfozm");

            Console.WriteLine($"Shortest path = {d17.ShortestPath(3, 3)}");
            Console.WriteLine($"Longest path = {d17.LongestPath(3, 3)}");
        }
Beispiel #3
0
        public void CannotMoveIntoWall()
        {
            var sut = new AdventOfCode2016.Day17.Day17("hijkl");

            Assert.False(sut.UpIsOpen(""));
            Assert.False(sut.LeftIsOpen(""));
            Assert.False(sut.RightIsOpen("RRR"));
            Assert.False(sut.DownIsOpen("DDD"));
        }
Beispiel #4
0
        public void CorrectDoorsAreOpen(string path, bool upIsOpen, bool downIsOpen,
                                        bool leftIsOpen, bool rightIsOpen)
        {
            var sut = new AdventOfCode2016.Day17.Day17("hijkl");

            Assert.Equal(upIsOpen, sut.UpIsOpen(path));
            Assert.Equal(downIsOpen, sut.DownIsOpen(path));
            Assert.Equal(leftIsOpen, sut.LeftIsOpen(path));
            Assert.Equal(rightIsOpen, sut.RightIsOpen(path));
        }