package seng302.Model;

import org.testng.annotations.Test;
import seng302.DataInput.PolarParser;
import seng302.Exceptions.InvalidPolarFileException;

import static org.testng.Assert.*;

/**
 * Created by f123 on 10-May-17.
 */
public class PolarsTest {

    @Test
    /**
     * Tests if we can parse a polar data file (stored in a string), create a polar table, and calculate VMG for a variety of values.
     */
    public void testParseAndVMG() throws Exception {

        //Read data.
        Polars polars;
        try {
            //Parse data file.
            polars = PolarParser.parse("polars/acc_polars.csv");
        }
        catch (InvalidPolarFileException e) {
            assertTrue(false);
        }

        //Test 1.
        //TODO make these tests actually do something when the calculateVMG function is added.
        double windAngle1 = 31.5;
        double destAngle1 = 65.32;
        double windSpeed1 = 15;//knots
        //double vmgAngle1 = TODO;
        //double vmgSpeed1 = TODO;

        //VMG calcVMG1 = Polars.calculateVMG(windAngle1, destAngle1, windSpeed1);
        //double calcVMGAngle1 = calcVMG1.getKey();
        //double calcVMGSpeed1 = calcVMG1.getValue();

        //assertEquals(vmgAngle1, calcVMGAngle1, 0.1);
        //assertEquals(vmgSpeed1, calcVMGSpeed1, 0.1);

    }

}
