Ejemplo n.º 1
0
        public void TestPartOne(string expected, string[] input)
        {
            Day08Solver s      = new Day08Solver();
            string      result = s.SolvePartOne(input, 2, 2);

            Assert.That(result, Is.EqualTo(expected));
        }
Ejemplo n.º 2
0
        public void TestPart1Solution(string inputFile, int expected)
        {
            // Arrange
            string[] lines = System.IO.File.ReadAllLines($"../../../{inputFile}");

            // Act
            var result = Day08Solver.Part1Solution(lines);

            // Assert
            Assert.Equal(expected, result);
        }
Ejemplo n.º 3
0
        public void TestPart1()
        {
            var input = @"nop +0
acc +1
jmp +4
acc +3
jmp -3
acc -99
acc +1
jmp -4
acc +6";

            var lines  = input.Split('\n');
            var result = Day08Solver.Part1(lines);

            Assert.Equal(5, result);
        }
Ejemplo n.º 4
0
        public void TestSolvePartB()
        {
            Solver s = new Day08Solver();
            IEnumerable <string> input = new List <string>
            {
                "nop +0",
                "acc +1",
                "jmp +4",
                "acc +3",
                "jmp -3",
                "acc -99",
                "acc +1",
                "jmp -4",
                "acc +6"
            };

            Assert.AreEqual("8", s.SolvePartB(input));
        }
Ejemplo n.º 5
0
        internal static void Part1()
        {
            var input = Input.Lines(8);

            Console.WriteLine(Day08Solver.Part1(input));
        }