Exemple #1
0
        public void ShouldReturnPositionsForAcross()
        {
            var inlineBattleshipPlacement = new SingleLineBattleshipPlacement(3);
            var shipPlacement             = new ShipPlacement('C', 0, Direction.Across);

            var shipPositions = inlineBattleshipPlacement.GetShipPositions(shipPlacement);

            shipPositions.Should().Equal(('C', 0), ('D', 0), ('E', 0));
        }
Exemple #2
0
        public void ShouldReturnPositionsForDown()
        {
            var inlineBattleshipPlacement = new SingleLineBattleshipPlacement(3);
            var shipPlacement             = new ShipPlacement('D', 3, Direction.Down);

            var shipPositions = inlineBattleshipPlacement.GetShipPositions(shipPlacement);

            shipPositions.Should().Equal(('D', 3), ('D', 4), ('D', 5));
        }
Exemple #3
0
        public void ShouldReturnPositionsForSingleInlinePlacement(Direction direction)
        {
            var inlineBattleshipPlacement = new SingleLineBattleshipPlacement(1);
            var shipPlacement             = new ShipPlacement('A', 0, direction);

            var shipPositions = inlineBattleshipPlacement.GetShipPositions(shipPlacement);

            shipPositions.Should().Equal(('A', 0));
        }