예제 #1
0
        public void TestPartTwoSample()
        {
            string input = "swap position 4 with position 0\nswap letter d with letter b\n" +
                           "reverse positions 0 through 4\nrotate left 1 step\nmove position 1 to position 4\n" +
                           "move position 3 to position 0\nrotate based on position of letter b\nrotate based on position of letter d";

            Assert.Equal("efghdabc", Day21.PartTwo(input.Split("\n")));
        }
예제 #2
0
        public void Day21Test1()
        {
            // arrange
            var path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            path = Path.GetFullPath(Path.Combine(path, "..", "..", ".."));

            var inputFile = Directory.GetFiles(path + @"/TestInput", "Day21_1.txt")[0];
            var day21     = new Day21(inputFile);

            // act
            var result1 = day21.PartOne();
            var result2 = day21.PartTwo();

            // assert
            Assert.Equal("5", result1);
            Assert.Equal("mxmxvkd,sqjhc,fvjkl", result2);
        }
예제 #3
0
        public void TestPartTwoInput()
        {
            string input = System.IO.File.ReadAllText("./Inputs/Day21.in");

            Assert.Equal("gcehdbfa", Day21.PartTwo(input.Split("\r\n")));
        }