示例#1
0
        public void ThenARandomPlacementIsSelected()
        {
            var ship = new TestShip();

            _grid.PlaceShipAtRandom(ship);

            _randomPlacementSelector.Received(1).Select(_grid.Squares, ship.Size);
        }
示例#2
0
        public void ThenTheShipOccupiesTheSquares()
        {
            var ship = new TestShip();

            _grid.PlaceShipAtRandom(ship);

            Assert.Same(_squarePlacement, ship.SquarePlacement);
        }
示例#3
0
        public void ThenShipIsAddedToGrid()
        {
            var ship = new TestShip();

            _grid.PlaceShipAtRandom(ship);

            Assert.Contains(ship, _grid.Ships);
        }