Example #1
0
            public when_attempting_to_place_a_ship_on_the_same_location()
            {
                mockCoordGenerator = new MockCoordGenerator(new[] { 'b', 'd', 'g' }, new[] { '2', '1', '0' });
                var shipPlacer = new ShipPlacer(mockCoordGenerator.GenerateCoords);

                board = shipPlacer.PlaceShipOfLength(new GameBoard(), 4, () => ShipDirection.Horizontal);
                board = shipPlacer.PlaceShipOfLength(board, 4, () => ShipDirection.Vertical);
            }
Example #2
0
            public when_placing_a_ship_of_length_four_vertically()
            {
                var mockCoordsPlacer = new MockCoordGenerator(new[] { 'a' }, new[] { '1' });
                var shipPlacer       = new ShipPlacer(mockCoordsPlacer.GenerateCoords);

                board = shipPlacer.PlaceShipOfLength(new GameBoard(), 4, () => ShipDirection.Vertical);
            }
Example #3
0
                public when_placing_a_ship_horizontally()
                {
                    var mockCoordsPlacer = new MockCoordGenerator(new[] { 'g' }, new[] { '1' });
                    var shipPlacer       = new ShipPlacer(mockCoordsPlacer.GenerateCoords);

                    board = shipPlacer.PlaceShipOfLength(new GameBoard(), 4, () => ShipDirection.Horizontal);
                }
Example #4
0
            public when_placing_a_ship_of_length_four_diagonally_down_and_left()
            {
                _mockCoordsPlacer = new MockCoordGenerator(new[] { 'j' }, new[] { '1' });
                var shipPlacer = new ShipPlacer(_mockCoordsPlacer.GenerateCoords);

                board = shipPlacer.PlaceShipOfLength(new GameBoard(), 4, () => ShipDirection.DiagonallyDownAndLeft);
            }