public void TestSeaGridMoveShip() { Ship destroyer = _ships[ShipName.Destroyer]; _seaGrid.MoveShip(5, 5, ShipName.Destroyer, Direction.LeftRight); Assert.IsTrue(destroyer.IsDeployed); }
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); }
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]); }
public void SeaGridMoveShipTest() { seaGrid = new SeaGrid(Ships); seaGrid.MoveShip(0, 0, ShipName.Tug, Direction.LeftRight); Assert.AreEqual(seaGrid.Item(0, 0), TileView.Ship); }