Example #1
0
        public void CanSolvePositionCharsPasswordRule(string[] passwords, int expected)
        {
            var day2   = new Day2();
            var result = day2.Solve <PositionCharsPasswordRule>(passwords);

            Assert.Equal(expected, result);
        }
Example #2
0
        public void Part2FullTest()
        {
            var input  = new[] { "5 9 2 8", "9 4 7 3", "3 8 6 5" };
            var result = Day2.Solve(input, Day2.Part2LineLogic);

            Assert.Equal(9, result);
        }
Example #3
0
        public void Part1FullTest()
        {
            var input  = new[] { "5 1 9 5", "7 5 3", "2 4 6 8" };
            var result = Day2.Solve(input, Day2.Part1LineLogic);

            Assert.Equal(18, result);
        }
Example #4
0
        public void Part2RealPuzzle()
        {
            var result = Day2.Solve(GetPuzzleInput(), Day2.Part2LineLogic);

            Assert.Equal(250, result);
        }
Example #5
0
        public void Part1RealPuzzle()
        {
            var result = Day2.Solve(GetPuzzleInput(), Day2.Part1LineLogic);

            Assert.Equal(47136, result);
        }