Пример #1
0
        public void Part2GetBathroomCodeReturnsCorrectValue(string instructions, string expected)
        {
            var sut = new Day2Part2(instructions);

            var actual = sut.GetBathroomCode();

            Assert.Equal(expected, actual);
        }
Пример #2
0
        public void Day2_2_Calculate()
        {
            var input1 = new List <string>
            {
                "abcde", "fghij", "klmno", "pqrst", "fguij", "axcye", "wvxyz"
            };
            var result1 = Day2Part2.Calculate(input1);

            Assert.AreEqual(1, result1.Count());
            Assert.AreEqual("fgij", result1.First());

            var input2 = FileUtil.Get2018File("Day2.txt");

            var result2 = Day2Part2.Calculate(input2);

            Assert.AreEqual(1, result2.Count());
            Assert.AreEqual("wugbihckpoymcpaxefotvdzns", result2.First());
        }
Пример #3
0
 public void Day2_2_DifferByOne()
 {
     Assert.AreEqual(null, Day2Part2.DifferByOne("abcde", "axcye"));
     Assert.AreEqual("fgij", Day2Part2.DifferByOne("fghij", "fguij"));
 }
Пример #4
0
        public void Solution()
        {
            var input = InputReader.ReadIntCsv("Day02/Input.txt");

            Console.WriteLine(Day2Part2.Result(input));
        }