package seng302.Networking;

import org.junit.Test;

import static org.junit.Assert.assertTrue;
import static seng302.Networking.Utils.AC35UnitConverter.*;

/**
 * Created by fwy13 on 4/05/17.
 */
public class AC35UnitConverter {

    @Test
    public void testConvertGPS(){
        assertTrue(convertGPS(0) == 0);
        assertTrue(convertGPS(Integer.MAX_VALUE) == (double)Integer.MAX_VALUE * 180.0 / Math.pow(2, 31));

    }


    @Test
    public void testConvertGPSToInt(){
        assertTrue(convertGPSToInt(0) == 0);
        assertTrue(convertGPSToInt(180) == (int)2147483648.0);

    }

    @Test
    public void testConvertHeading(){
        assertTrue(convertHeading(0) == 0);
        assertTrue(convertHeading(65536) == 360.0);
    }


    @Test
    public void testConvertTrueWindAngle(){
        assertTrue(convertTrueWindAngle(0) == 0);
        assertTrue(convertTrueWindAngle(32768) == 180.0);
    }
}
