@@ -0,0 +1,2185 @@
+// WinControllerTest.java%0A%0Apackage de.htwg.battleship.controller;%0A%0Aimport de.htwg.battleship.controller.impl.ShipController;%0Aimport de.htwg.battleship.controller.impl.ShootController;%0Aimport de.htwg.battleship.controller.impl.WinController;%0Aimport de.htwg.battleship.model.IPlayer;%0Aimport de.htwg.battleship.model.IShip;%0Aimport de.htwg.battleship.model.impl.Board;%0Aimport de.htwg.battleship.model.impl.Player;%0Aimport de.htwg.battleship.model.impl.Ship;%0Aimport org.junit.After;%0Aimport static org.junit.Assert.assertEquals;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0A/**%0A * WinControllerTest%0A * @author Moritz Sauter (SauterMoritz@gmx.de)%0A * @version 1.00%0A * @since 2014-12-14%0A */%0Apublic class WinControllerTest %7B%0A%0A    IWinLooseController wc;%0A    IShipController shipC;%0A    IShootController shootC;%0A    IPlayer player1;%0A    IPlayer player2;%0A    IShip ship1;%0A    IShip ship2;%0A    %0A    public WinControllerTest() %7B%0A    %7D%0A%0A    @Before%0A    public void setUp() %7B%0A        player1 = new Player(new Board());%0A        player2 = new Player(new Board());%0A        ship1 = new Ship(2, true, 4, 4);%0A        ship2 = new Ship(1, true, 1, 1);%0A        shipC = new ShipController(player1, player2);%0A        shipC.placeShip(ship1, true);%0A        shipC.placeShip(ship2, false);%0A        shootC = new ShootController(player1, player2);%0A        wc = new WinController(player1, player2);%0A    %7D%0A%0A    @After%0A    public void tearDown() %7B%0A    %7D%0A%0A    /**%0A     * Test of win method, of class WinController.%0A     */%0A    @Test%0A    public void testNullWin() %7B%0A        IPlayer expRes = null;%0A        IPlayer result = wc.win();%0A        assertEquals(expRes, result);%0A    %7D%0A%0A    /**%0A     * Test of win method, result player1.%0A     */%0A    @Test%0A    public void testPlayer1Win() %7B%0A        IPlayer expRes = player1;%0A        shootC.shoot(1, 1, true);%0A        IPlayer result = wc.win();%0A        assertEquals(expRes, result);%0A    %7D%0A    %0A    /**%0A     * Test of win method, result player2.%0A     */%0A    @Test%0A    public void testPlayer2Win() %7B%0A        IPlayer expRes = player2;%0A        shootC.shoot(4, 4, false);%0A        shootC.shoot(5, 4, false);%0A        IPlayer result = wc.win();%0A        assertEquals(expRes, result);%0A    %7D%0A%7D

test for win controller