Пример #1
0
        private void Setup()
        {
            _shipLength = 1;
            _ship       = LongShip.CreateShip(_shipLength);

            _defaultStatus = AttackStatus.NotAttacked;
            _position      = new Position("A", 1);
            _location      = BasicLocation.CreateLocation(_position);
        }
Пример #2
0
        public void OccupyLocationTwice()
        {
            Setup();
            IShip ship = LongShip.CreateShip(_shipLength);

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

            Assert.Throws <LocationOccupiedException>(test);
            TearDown();
        }
Пример #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);
 }
Пример #4
0
        public void CreateShip()
        {
            TestDelegate test = () => LongShip.CreateShip(_shipLength);

            Assert.DoesNotThrow(test);
        }
Пример #5
0
        public void CreateZeroLengthShip()
        {
            TestDelegate test = () => LongShip.CreateShip(0);

            Assert.Throws <ShipSizeException>(test);
        }
Пример #6
0
 public void Setup()
 {
     _shipLength = 1;
     _ship       = LongShip.CreateShip(_shipLength);
 }