Exemplo n.º 1
0
        private void Setup()
        {
            _shipLength = 1;
            _ship       = LongShip.CreateShip(_shipLength);

            _defaultStatus = AttackStatus.NotAttacked;
            _position      = new Position("A", 1);
            _location      = BasicLocation.CreateLocation(_position);
        }
Exemplo n.º 2
0
        public void OccupyLocationTwice()
        {
            Setup();
            IShip ship = LongShip.CreateShip(_shipLength);

            _location.Occupy(ship);
            TestDelegate test = () => _location.Occupy(_ship);

            Assert.Throws <LocationOccupiedException>(test);
            TearDown();
        }
Exemplo n.º 3
0
 void IBoard.PositionBattleship(int battleshipLength, string battleshipRow, int battleshipColumn, Orientation battleshipOrientation)
 {
     //this.PositionBattleship(LongShip.CreateShip(battleshipLength), new Position(battleshipRow, battleshipColumn), battleshipOrientation);
     PositionShipOnArrayBoard.PositionShip(_board, LongShip.CreateShip(battleshipLength), new Position(battleshipRow, battleshipColumn), battleshipOrientation);
 }
Exemplo n.º 4
0
        public void CreateShip()
        {
            TestDelegate test = () => LongShip.CreateShip(_shipLength);

            Assert.DoesNotThrow(test);
        }
Exemplo n.º 5
0
        public void CreateZeroLengthShip()
        {
            TestDelegate test = () => LongShip.CreateShip(0);

            Assert.Throws <ShipSizeException>(test);
        }
Exemplo n.º 6
0
 public void Setup()
 {
     _shipLength = 1;
     _ship       = LongShip.CreateShip(_shipLength);
 }