示例#1
0
        public void InIt()
        {
            _mockData = new List <string>()
            {
                "L.LL.LL.LL",
                "LLLLLLL.LL",
                "L.L.L..L..",
                "LLLL.LL.LL",
                "L.LL.LL.LL",
                "L.LLLLL.LL",
                "..L.L.....",
                "LLLLLLLLLL",
                "L.LLLLLL.L",
                "L.LLLLL.LL"
                //"#.##.##.##",
                //"#######.##",
                //"#.#.#..#..",
                //"####.##.##",
                //"#.##.##.##",
                //"#.#####.##",
                //"..#.#.....",
                //"##########",
                //"#.######.#",
                //"#.#####.##"
            };
            var autoMocker = new AutoMoqer();

            _fileReaderMock = autoMocker.GetMock <IFileReader>();
            _fileReaderMock.Setup(f => f.ReadFileToStringArray(It.IsAny <string>())).Returns(_mockData);

            _solution = new Day11Solution(_fileReaderMock.Object);
        }
示例#2
0
        public void SolvesPart2(int serial, int x, int y, int size)
        {
            var subject = new Day11Solution();

            (int, int, int)result = subject.SolvePart2(serial);

            result.Should().Be((x, y, size));
        }
示例#3
0
        public void SolvesPart1()
        {
            var subject = new Day11Solution();

            (int, int)result = subject.SolvePart1(18);

            result.Should().Be((33, 45));
        }
示例#4
0
        public void CalculatesPowerLevel(int x, int y, int serialNumber, int expected)
        {
            var subject = new Day11Solution();

            int result = subject.PowerLevel(x, y, serialNumber);

            result.Should().Be(expected);
        }