Esempio n. 1
0
        public void ValidateMap_SetsProperMapMapSizeAndShipList_ReturnsTrue(int id)
        {
            ShipsMap shipsMap = new ShipsMap(maps[id], mapSizes[id], shipsLists[id]);
            bool     result   = shipsMap.ValidateMap();

            Assert.True(result);
        }
Esempio n. 2
0
        public void ValidateMap_SetsProperMapAndShipListAndWrongMapSize_ReturnsFalse(
            [Values(0, 1, 2, 3)] int id, [Values(-5, 1, 0, 20)] short mapSize)
        {
            ShipsMap shipsMap = new ShipsMap(maps[id], mapSize, shipsLists[id]);
            bool     result   = shipsMap.ValidateMap();

            Assert.False(result);
        }
Esempio n. 3
0
        public void Shoot_SetsCoordinatesOnShip_ReturnHitString(int id, int x, int y)
        {
            ShipsMap shipsMap = new ShipsMap(maps[id], mapSizes[id], shipsLists[id]);

            shipsMap.ValidateMap();
            string result = shipsMap.Shoot(x, y);

            Assert.AreEqual("hit", result);
        }
Esempio n. 4
0
        public void ValidateMap_SetsProperMapAndMapSizeAndWrongShipList_ReturnsFalse(int id)
        {
            short[] wrongShipList = { 3, 3, 3, 3 };

            ShipsMap shipsMap = new ShipsMap(maps[id], mapSizes[id], wrongShipList);
            bool     result   = shipsMap.ValidateMap();

            Assert.False(result);
        }