예제 #1
0
        public int TurningOnLights(int fromX, int fromY, int toX, int toY)
        {
            var grid = new BinaryLightingGrid();

            grid.ProcessInstruction("turn on", fromX, fromY, toX, toY);
            return(grid.HowManyLightsAreLit());
        }
예제 #2
0
        public void ItsDarkOnStart()
        {
            var grid        = new BinaryLightingGrid();
            var lightsCount = grid.HowManyLightsAreLit();

            Assert.That(lightsCount, Is.EqualTo(0));
        }
예제 #3
0
        public void CanReset()
        {
            var grid = new BinaryLightingGrid();

            grid.ProcessInstruction("turn on", 1, 1, 5, 5);
            var lightsCount = grid.HowManyLightsAreLit();

            Assert.That(lightsCount, Is.EqualTo(25));

            grid.Reset();
            lightsCount = grid.HowManyLightsAreLit();
            Assert.That(lightsCount, Is.EqualTo(0));
        }