コード例 #1
0
        public void GetAdjacentOccupiedSeatsCount_Works_Correctly()
        {
            const string data  = @"
L#.
L##
###
";
            var          cells = Parser.Parse(data);

            Assert.That(Model1.GetAdjacentOccupiedSeatsCount(cells, 0, 0), Is.EqualTo(2));
            Assert.That(Model1.GetAdjacentOccupiedSeatsCount(cells, 1, 0), Is.EqualTo(2));
            Assert.That(Model1.GetAdjacentOccupiedSeatsCount(cells, 2, 0), Is.EqualTo(3));
            Assert.That(Model1.GetAdjacentOccupiedSeatsCount(cells, 0, 1), Is.EqualTo(4));
            Assert.That(Model1.GetAdjacentOccupiedSeatsCount(cells, 1, 1), Is.EqualTo(5));
            Assert.That(Model1.GetAdjacentOccupiedSeatsCount(cells, 2, 1), Is.EqualTo(4));
            Assert.That(Model1.GetAdjacentOccupiedSeatsCount(cells, 0, 2), Is.EqualTo(2));
            Assert.That(Model1.GetAdjacentOccupiedSeatsCount(cells, 1, 2), Is.EqualTo(4));
            Assert.That(Model1.GetAdjacentOccupiedSeatsCount(cells, 2, 2), Is.EqualTo(3));
        }