public void BuildMapWithAMountain_GetMap_ReturnsAMapWithAMountain()
        {
            string           expectedCellType    = "M";
            int              expectedXCoordinate = 2;
            int              expectedYCoordinate = 3;
            MapMountainEntry mountainEntry       = new MapMountainEntry(expectedCellType, new[] { expectedXCoordinate.ToString(), expectedYCoordinate.ToString() });

            MapBuilder builder = new MapBuilder(new MapSizeEntry("C", new[] { "5", "5" }));

            builder.AddEntries(new[] { mountainEntry });
            Map result = builder.GetMap();

            Assert.That(result, Is.Not.Null);
            Assert.That(result.GetCellType(expectedXCoordinate, expectedYCoordinate), Is.EqualTo(expectedCellType));
        }
Esempio n. 2
0
        public void BuildMapWithAMountain_GetCellType_ReturnsEmptyCellType()
        {
            string           expectedCellType    = string.Empty;
            string           mountainCellType    = "M";
            int              mountainXCoordinate = 2;
            int              mountainYCoordinate = 3;
            MapMountainEntry mountainEntry       = new MapMountainEntry(mountainCellType, new[] { mountainXCoordinate.ToString(), mountainYCoordinate.ToString() });
            MapBuilder       builder             = new MapBuilder(new MapSizeEntry("C", new[] { "5", "5" }));

            builder.AddEntries(new[] { mountainEntry });
            Map map = builder.GetMap();

            var result = map.GetCellType(4, 4);

            Assert.That(result, Is.EqualTo(expectedCellType));
        }