package net.liquidpineapple.pang.objects;

import net.liquidpineapple.pang.objects.Ball;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import net.liquidpineapple.pang.objects.BallMovement;
import org.junit.Test;

public class BallTest {

    private Ball TestBallLeft = new Ball(0, 0, BallMovement.LEFT_MOVEMENT, 4);
    private Ball TestBallRight = new Ball(0, 0, BallMovement.RIGHT_MOVEMENT, 3);
    private Ball TestBallIncorrectSizeGreater = new Ball(0, 0, BallMovement.LEFT_MOVEMENT, 6);
    private Ball TestBallIncorrectSizeSmaller = new Ball(0, 0, BallMovement.RIGHT_MOVEMENT, 0);

    //Tests if the constructor handles left and right correctly.
    @Test
    public void testConstructorDirection() throws Throwable {
        assertEquals(-15, TestBallLeft.getMovX());
        assertEquals(15, TestBallRight.getMovX());
    }

   //Tests if the constructor handles sets movY correctly.
    @Test
    public void testConstructorYSpeed() throws Throwable {
        assertEquals(17, TestBallLeft.getMovY());
        assertEquals(14, TestBallRight.getMovY());
    }


    //Tests if the constructor handles size correctly
    @Test
    public void testConstructorSize() throws Throwable {
        assertEquals(4, TestBallLeft.getBallSize());
        assertEquals(3, TestBallRight.getBallSize());
    }

    //Tests if the constructor handles incorrect sizes correctly
    @Test
    public void testIncorrectSize() throws Throwable {
        assertEquals(4, TestBallIncorrectSizeGreater.getBallSize());
        assertEquals(4, TestBallIncorrectSizeSmaller.getBallSize());
    }

    @Test
    public void testMove() throws Exception {
        TestBallLeft.setPos(5, 5);
        TestBallLeft.setMovX(1);

        TestBallLeft.move();
        assertEquals(6, TestBallLeft.getXPos());

        TestBallLeft.setMovX(-1);
        TestBallLeft.move();
        assertEquals(5, TestBallLeft.getXPos());

        TestBallLeft.setMovY(1);
        TestBallLeft.move();
        assertEquals(48, TestBallLeft.getYPos());

        TestBallLeft.setMovY(-1);
        TestBallLeft.move();
        assertEquals(49, TestBallLeft.getYPos());

    }

}

@@ -47,47 +47,25 @@
 ort 
-net.liquidpineapple.pang.objects.Ball
+org.junit.Test
 ;%0A
+%0A
 impo
@@ -108,129 +108,8 @@
 als;
-%0Aimport static org.junit.Assert.assertTrue;%0A%0Aimport net.liquidpineapple.pang.objects.BallMovement;%0Aimport org.junit.Test;
 %0A%0Apu
@@ -642,18 +642,17 @@
 Equals(-
-15
+2
 , TestBa
@@ -695,10 +695,9 @@
 als(
-15
+2
 , Te
@@ -880,10 +880,9 @@
 als(
-17
+0
 , Te
@@ -929,10 +929,9 @@
 als(
-14
+0
 , Te
@@ -1876,10 +1876,10 @@
 als(
-48
+10
 , Te
@@ -1990,10 +1990,10 @@
 als(
-49
+10
 , Te

fix BallTest tests