<commit_before>// ShipControllerTest.java

package de.htwg.battleship.controller;

import de.htwg.battleship.controller.impl.ShipController;
import de.htwg.battleship.model.impl.Board;
import de.htwg.battleship.model.impl.Player;
import de.htwg.battleship.model.impl.Ship;
import de.htwg.battleship.util.StatCollection;
import org.junit.After;
import static org.junit.Assert.assertEquals;
import org.junit.Before;
import org.junit.Test;

/**
 * ShipControllerTest
 * @author <NAME> (<EMAIL>)
 * @version 1.00
 * @since 2014-11-27
 */
public class ShipControllerTest {
    
    ShipController sc;
    Player player1;
    Player player2;
    Ship ship1;
    Ship ship2;

    public ShipControllerTest() {
    }

    @Before
    public void setUp() {
        StatCollection.HEIGTH_LENGTH = 10;
        StatCollection.SHIP_NUMBER_MAX = 5;
        player1 = new Player(new Board());
        player2 = new Player(new Board());
        ship1 = new Ship(2, true, 1, 1);
        ship2 = new Ship(3, true, 1, 1);
        sc =  new ShipController();
    }

    @After
    public void tearDown() {
    }

    /**
     * Test of placeShip method, of class ShipController.
     */
    @Test
    public void testPlayer1PlaceShip() {
        boolean expRes = true;
        boolean result = sc.placeShip(ship1, player1);
        assertEquals(expRes, result);
        expRes = false;
        result = sc.placeShip(ship1, player1);
        assertEquals(expRes, result);
        expRes = false;
        result = sc.placeShip(ship2, player1);
        assertEquals(expRes, result);
    }
    
    @Test
    public void testPlayer2PlaceShip() {
        boolean expRes = true;
        boolean result = sc.placeShip(ship1, player2);
        assertEquals(expRes, result);
        expRes = false;
        result = sc.placeShip(ship1, player2);
        assertEquals(expRes, result);
        expRes = false;
        result = sc.placeShip(ship2, player2);
        assertEquals(expRes, result);
    }

}<commit_msg>modified shipController test, now Border Controller is false<commit_after>// ShipControllerTest.java

package de.htwg.battleship.controller;

import de.htwg.battleship.controller.impl.ShipController;
import de.htwg.battleship.model.IPlayer;
import de.htwg.battleship.model.impl.Board;
import de.htwg.battleship.model.impl.Player;
import de.htwg.battleship.model.impl.Ship;
import de.htwg.battleship.util.StatCollection;
import org.junit.After;
import static org.junit.Assert.assertEquals;
import org.junit.Before;
import org.junit.Test;

/**
 * ShipControllerTest
 * @author <NAME> (<EMAIL>)
 * @version 1.00
 * @since 2014-11-27
 */
public class ShipControllerTest {
    
    ShipController sc;
    Player player1;
    Player player2;
    Ship ship1;
    Ship ship2;

    public ShipControllerTest() {
    }

    @Before
    public void setUp() {
        StatCollection.HEIGTH_LENGTH = 10;
        StatCollection.SHIP_NUMBER_MAX = 5;
        player1 = new Player(new Board());
        player2 = new Player(new Board());
        ship1 = new Ship(2, true, 1, 1);
        ship2 = new Ship(3, true, 1, 1);
        sc =  new ShipController();
    }

    @After
    public void tearDown() {
    }

    /**
     * Test of placeShip method, of class ShipController.
     */
    @Test
    public void testPlayer1PlaceShip() {
        boolean expRes = true;
        boolean result = sc.placeShip(ship1, player1);
        assertEquals(expRes, result);
        expRes = false;
        result = sc.placeShip(ship1, player1);
        assertEquals(expRes, result);
        expRes = false;
        result = sc.placeShip(ship2, player1);
        assertEquals(expRes, result);
    }
    
    @Test
    public void testPlayer2PlaceShip() {
        boolean expRes = true;
        boolean result = sc.placeShip(ship1, player2);
        assertEquals(expRes, result);
        expRes = false;
        result = sc.placeShip(ship1, player2);
        assertEquals(expRes, result);
        expRes = false;
        result = sc.placeShip(ship2, player2);
        assertEquals(expRes, result);
    }

    @Test
    public void testBorderPlaceShip() {
        boolean expRes = false;
        StatCollection.HEIGTH_LENGTH = 2;
        IPlayer pl = new Player();
        boolean result = sc.placeShip(ship2, pl);
    }
}
{'fraction_non_alphanumeric': 0.10910793725122922, 'fraction_numerical': 0.02013579957855303, 'mean_word_length': 2.611158072696534, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3319026', 'n_tokens_mistral': 1370, 'n_tokens_neox': 1342, 'n_words': 310}