Example #1
0
        public void FindPointTest()
        {
            var result = Day3.FindPointForNumber(16);

            Assert.Equal(new Point(2, 5), result);

            result = Day3.FindPointForNumber(10);
            Assert.Equal(new Point(5, 2), result);

            result = Day3.FindPointForNumber(25);
            Assert.Equal(new Point(5, 1), result);

            result = Day3.FindPointForNumber(9);
            Assert.Equal(new Point(3, 1), result);
        }
Example #2
0
        public void TestPartA()
        {
            string[] slopeDefinition = new string[] {
                "..##.......",
                "#...#...#..",
                ".#....#..#.",
                "..#.#...#.#",
                ".#...##..#.",
                "..#.##.....",
                ".#.#.#....#",
                ".#........#",
                "#.##...#...",
                "#...##....#",
                ".#..#...#.#"
            };
            var  data           = new StringData(slopeDefinition);
            int  expectedOutput = 7;
            Day3 day3           = new Day3(data);

            var actualOutut = day3.Puzzle1Solution();


            Assert.AreEqual(expectedOutput, actualOutut);
        }
Example #3
0
 public void TestDay3Part2(string[] input, int answer)
 {
     Day3.
     Part2(input).
     ShouldBeEquivalentTo(answer);
 }
Example #4
0
 public void GeneratesProperCoordinates()
 {
     var day3 = new Day3();
 }
Example #5
0
        public void Part2RealPuzzle()
        {
            var result = Day3.SolvePart2(GetPuzzleInput());

            Assert.Equal(369601, result);
        }
Example #6
0
        public void Part2Tests(int input, int expected)
        {
            var result = Day3.SolvePart2(input);

            Assert.Equal(expected, result);
        }
Example #7
0
        public void CalculateGridSize(int input, int expected)
        {
            var result = Day3.CalculateGridSize(input);

            Assert.Equal(expected, result);
        }