@@ -0,0 +1,2420 @@
+package nl.github.martijn9612.fishy;%0A%0Aimport static org.junit.Assert.*;%0A%0Aimport org.junit.Test;%0Aimport org.newdawn.slick.GameContainer;%0A%0Aimport static org.mockito.Mockito.mock;%0A%0Apublic class OpponentTest %7B%0A    private final GameContainer gc = mock(GameContainer.class);%0A%0A    /**%0A     * Test case for getSize method%0A     */%0A    @Test%0A    public void testGetSize() %7B%0A        Opponent testopp = new Opponent(true, 0, 0, 1.0, 0);%0A        assertEquals(testopp.getSize(), 1.0, 0.1);%0A    %7D%0A%0A    /**%0A     * Test case for isOffScreen method.%0A     * spawnsleft = true. %0A     * Return condition = true.%0A     */%0A    @Test%0A    public void testIsOffScreen1() %7B%0A        Opponent testtruetrue = new Opponent(true, 10, 0, 1, 0);%0A        assertTrue(testtruetrue.isOffScreen());%0A    %7D%0A%0A    /**%0A     * Test case for isOffScreen method.%0A     * spawnsleft = true. %0A     * Return condition = false.%0A     */%0A    @Test%0A    public void testIsOffScreen2() %7B%0A        Opponent testtruefalse = new Opponent(true, 0, 0, 1, 0);%0A        assertFalse(testtruefalse.isOffScreen());%0A    %7D%0A%0A    /**%0A     * Test case for isOffScreen method.%0A     * spawnsleft = false.%0A     * Return condition = true.%0A     */%0A    @Test%0A    public void testIsOffScreen3() %7B%0A        Opponent testfalsetrue = new Opponent(false, -2, 0, 1, 0);%0A        assertTrue(testfalsetrue.isOffScreen());%0A    %7D%0A%0A    /**%0A     * Test case for isOffScreen method.%0A     * spawnsleft = false.%0A     * Return condition = false.%0A     */%0A    @Test%0A    public void testIsOffScreen4() %7B%0A        Opponent testfalsefalse = new Opponent(false, 10, 0, 1, 0);%0A        assertFalse(testfalsefalse.isOffScreen());%0A    %7D%0A%0A    /**%0A     * Test case for objectLogic method.%0A     * spawnsleft = true.%0A     */%0A    @Test%0A    public void testObjectLogic() %7B%0A        Opponent opp = new Opponent(true, 0, 0, 1, 1);%0A        float centerbefore = opp.ellipse.getCenterX();%0A        opp.objectLogic(gc, 0);%0A        assertEquals(opp.ellipse.getCenterX(), centerbefore + 1, 0.1);%0A        assertEquals(opp.getX(), 1, 0.1);%0A    %7D%0A%0A    /**%0A     * Test case for objectLogic method.%0A     * spawnsleft = false;%0A     */%0A    @Test%0A    public void testObjectLogic2() %7B%0A        Opponent opp = new Opponent(false, 10, 10, 1, 1);%0A        float centerbefore = opp.ellipse.getCenterX();%0A        opp.objectLogic(gc, 0);%0A        assertEquals(opp.ellipse.getCenterX(), centerbefore - 1, 0.1);%0A        assertEquals(opp.getX(), 9.0, 0.1);%0A    %7D%0A%0A%7D%0A

test file for Opponent.java. Opponent.java has now 100% coverage <testing