package com.draga.ship;

import com.draga.Constants;
import org.junit.Assert;
import org.junit.Test;

import static org.junit.Assert.*;

/**
 * Created by Administrator on 17/09/2015.
 */
public class ShipPhysicComponentTest
{
    @Test
    public void testRotateTo() throws Exception
    {
        ShipPhysicComponent shipPhysicComponent = new ShipPhysicComponent();

        while (shipPhysicComponent.getRotation() != 180)
        {
            shipPhysicComponent.rotateTo(0, -Constants.EARTH_GRAVITY, 1f / 60f);
        }

        Assert.assertEquals(180f, shipPhysicComponent.getRotation(), 0);
    }
}
@@ -18,16 +18,54 @@
 .ship;%0A%0A
+import com.badlogic.gdx.math.Vector2;%0A
 import c
@@ -398,16 +398,102 @@
 onent();
+%0A        Vector2 accelerometerPointingLeft = new Vector2(-Constants.EARTH_GRAVITY, 0);
 %0A%0A      
@@ -538,19 +538,49 @@
 on() != 
-180
+accelerometerPointingLeft.angle()
 )%0A      
@@ -628,35 +628,33 @@
 eTo(
-0, -Constants.EARTH_GRAVITY
+accelerometerPointingLeft
 , 1f

fix unit test