Пример #1
0
        public void ReturnsPowerLevelOfGrid(int serialNumber, int x, int y, int expectedPowerLevel)
        {
            var powerGrid = new Day11Solver.PowerGrid(serialNumber);
            var cellGrid  = powerGrid.GetCellGrid(x, y, 3);

            Assert.Equal(expectedPowerLevel, cellGrid.PowerLevel);
        }
Пример #2
0
        public void ReturnsGridWithHighestPowerLevel(int serialNumber,
                                                     int expectedX,
                                                     int expectedY,
                                                     int expectedPowerLevel)
        {
            var powerGrid       = new Day11Solver.PowerGrid(serialNumber);
            var highestCellGrid = powerGrid.FindHighestLevelCellGrid(3);

            Assert.Equal(expectedX, highestCellGrid.X);
            Assert.Equal(expectedY, highestCellGrid.Y);
            Assert.Equal(3, highestCellGrid.Size);
            Assert.Equal(expectedPowerLevel, highestCellGrid.PowerLevel);
        }
Пример #3
0
        public void ReturnsVariableGridWithHighestPowerLevel(int serialNumber,
                                                             int expectedX,
                                                             int expectedY,
                                                             int expectedSize,
                                                             int expectedPowerLevel)
        {
            var powerGrid      = new Day11Solver.PowerGrid(serialNumber);
            var splitPowerGrid = new Day11Solver.SplitPowerGrid(powerGrid);
            var cellGrid       = splitPowerGrid.FindHighestLevelCellGrid();

            Assert.Equal(expectedX, cellGrid.X);
            Assert.Equal(expectedY, cellGrid.Y);
            Assert.Equal(expectedSize, cellGrid.Size);
            Assert.Equal(expectedPowerLevel, cellGrid.PowerLevel);
        }