Пример #1
0
        public void Puzzle2ExampleTest()
        {
            // First test directly on AlchemicalReducer
            var ar = new Day05.AlchemicalReducer(inputDay05Example1);

            Assert.AreEqual(6, ar.ReduceWithSkip('A'));
            Assert.AreEqual(8, ar.ReduceWithSkip('B'));
            Assert.AreEqual(4, ar.ReduceWithSkip('C'));
            Assert.AreEqual(6, ar.ReduceWithSkip('D'));
            // Then test wrapper method
            Assert.AreEqual(4, Day05.Puzzle2(inputDay05Example1));
        }
Пример #2
0
 public void Puzzle2Test()
 {
     Assert.AreEqual(5312, Day05.Puzzle2(inputDay05));
 }
Пример #3
0
 public void Puzzle1Test()
 {
     Assert.AreEqual(10598, Day05.Puzzle1(inputDay05));
 }
Пример #4
0
 public void Puzzle1ExampleTest()
 {
     Assert.AreEqual(10, Day05.Puzzle1(inputDay05Example1));
 }
Пример #5
0
        public void Test_FindRow()
        {
            var row = Day05.FindRow("FBFBBFF");

            Assert.AreEqual(44, row);
        }
Пример #6
0
        public void Test_CutInHalf()
        {
            var range = Day05.CutInHalf('F', Enumerable.Range(0, 128)).ToList();

            Assert.AreEqual(0, range[0]);
            Assert.AreEqual(63, range[^ 1]);
Пример #7
0
        public void Test_FindSeat()
        {
            var column = Day05.FindSeat("RLR");

            Assert.AreEqual(5, column);
        }
Пример #8
0
        public void Part2_ValidInput_ProducesCorrectSolution(string input, int expected)
        {
            var actual = new Day05().Part2(input);

            Assert.Equal(expected, actual);
        }