Beispiel #1
0
        public void GetMapPartTest(int size)
        {
            // Arrange
            var mapCellsFactory = new Func <IAreaMapCellInternal>(() => new Mock <IAreaMapCellInternal>().Object);

            var map = new AreaMap(1, mapCellsFactory, 30, 30);

            // Act
            var area = map.GetMapPart(new Point(1, 1), size);

            // Assert
            var expectedAreaDiameter = size * 2 + 1;

            Assert.AreEqual(expectedAreaDiameter, area.Length);
            Assert.IsTrue(area.All(row => row.Length == expectedAreaDiameter));
        }