示例#1
0
        public void TestSeaGridMoveShip()
        {
            Ship destroyer = _ships[ShipName.Destroyer];

            _seaGrid.MoveShip(5, 5, ShipName.Destroyer, Direction.LeftRight);
            Assert.IsTrue(destroyer.IsDeployed);
        }
示例#2
0
        public void SeaGridHitTileTest()
        {
            seaGrid = new SeaGrid(Ships);
            seaGrid.MoveShip(0, 0, ShipName.Tug, Direction.LeftRight);
            AttackResult ar = seaGrid.HitTile(0, 0);

            Assert.AreEqual(ar.Value, ResultOfAttack.Destroyed);
        }
示例#3
0
        public void TestShipDeployed()
        {
            int     offset  = 0;
            SeaGrid seaGrid = new SeaGrid(_ships);

            foreach (KeyValuePair <ShipName, Ship> entry in _ships)
            {
                ShipName name = entry.Key;
                Ship     ship = entry.Value;
                seaGrid.MoveShip(0, offset++, name, Direction.UpDown);
                Assert.IsTrue(ship.IsDeployed);
            }
        }
 public void TestSeaGridAdapterViewShip()
 {
     _seaGrid.MoveShip(0, 0, ShipName.Destroyer, Direction.LeftRight);
     Assert.AreEqual(TileView.Sea, _adapter[0, 0]);
 }
示例#5
0
 public void SeaGridMoveShipTest()
 {
     seaGrid = new SeaGrid(Ships);
     seaGrid.MoveShip(0, 0, ShipName.Tug, Direction.LeftRight);
     Assert.AreEqual(seaGrid.Item(0, 0), TileView.Ship);
 }