@@ -0,0 +1,2439 @@
+// ShootControllerTest.java%0A%0Apackage de.htwg.battleship.controller;%0A%0Aimport de.htwg.battleship.objects.Board;%0Aimport de.htwg.battleship.objects.Player;%0Aimport de.htwg.battleship.objects.Ship;%0Aimport org.junit.After;%0Aimport static org.junit.Assert.assertEquals;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0A/**%0A * ShootControllerTest%0A * @author Moritz Sauter (SauterMoritz@gmx.de)%0A * @version 1.00%0A * @since 2014-11-19%0A */%0Apublic class ShootControllerTest %7B%0A%0A    ShootController sc;%0A    Player player;%0A    %0A    public ShootControllerTest() %7B%0A    %7D%0A%0A    @Before%0A    public void setUp() %7B%0A        player = new Player(new Board(), new Board());%0A        Ship ship1 = new Ship(5, true, new int%5B%5D %7B 3, 2 %7D);%0A        Ship ship2 = new Ship(1, false, new int%5B%5D %7B 6, 6 %7D);%0A        player.getShootBoard().addShip(ship1);%0A        player.getShootBoard().addShip(ship2);%0A        sc = new ShootController(player);%0A    %7D%0A%0A    @After%0A    public void tearDown() %7B%0A    %7D%0A%0A    /**%0A     * Test shoot-Method.%0A     * Hit-/Non-Hit - Test.%0A     * Ship-Orientation is true.%0A     */%0A    @Test%0A    public void shootTestOneOriTrue() %7B%0A        boolean expResult = true;%0A        boolean result = sc.shoot(3, 2);%0A        assertEquals(expResult, result);%0A        expResult = false;%0A        result = sc.shoot(3, 3);%0A        assertEquals(expResult, result);%0A    %7D%0A    %0A    /**%0A     * Test shoot-Method.%0A     * Hit-/Non-Hit - Test.%0A     * Ship-Orientation is true.%0A     */%0A    @Test%0A    public void shootTestTwoOriTrue() %7B%0A        boolean expResult = false;%0A        boolean result = sc.shoot(3, 2); // first Time true, second time false%0A        result = sc.shoot(3, 2);%0A        assertEquals(expResult, result);%0A        result = sc.shoot(9, 2);%0A        assertEquals(expResult, result);%0A        result = sc.shoot(2, 2);%0A        assertEquals(expResult, result);%0A    %7D%0A    %0A    @Test%0A    public void shootTestOneOriFalse() %7B%0A        boolean expResult = true;%0A        boolean result = sc.shoot(6, 6);%0A        assertEquals(expResult, result);%0A        expResult = false;%0A        result = sc.shoot(6, 6);%0A        assertEquals(expResult, result);%0A    %7D%0A    %0A    @Test%0A    public void shootTestTwoOriFalse() %7B%0A        boolean expResult = false;%0A        boolean result = sc.shoot(6, 5);%0A        assertEquals(expResult, result);%0A        result = sc.shoot(6, 8);%0A        assertEquals(expResult, result);%0A        result = sc.shoot(5, 6);%0A        assertEquals(expResult, result);%0A    %7D%0A%7D

Test for the shootController