Filled in javadoc, optimised imports, rearranged code
#refactor #story[16]
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package seng302.Model;
|
||||
|
||||
import javafx.scene.paint.Color;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import seng302.GPSCoordinate;
|
||||
|
||||
@@ -14,7 +13,6 @@ import static junit.framework.TestCase.assertTrue;
|
||||
public class BoatInRaceTest {
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
public void calculateDueNorthAzimuthReturns0() {
|
||||
BoatInRace boat = new BoatInRace("Test", 1, Color.ALICEBLUE, "tt");
|
||||
|
||||
@@ -4,11 +4,9 @@ package seng302.Model;
|
||||
import javafx.scene.paint.Color;
|
||||
import org.geotools.referencing.GeodeticCalculator;
|
||||
import org.junit.Test;
|
||||
import org.opengis.geometry.coordinate.Geodesic;
|
||||
import seng302.Constants;
|
||||
import seng302.GPSCoordinate;
|
||||
|
||||
import java.awt.geom.Point2D;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
@@ -22,7 +20,6 @@ public class ConstantVelocityRaceTest {
|
||||
int ONE_HOUR = 3600000; //1 hour in milliseconds
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
public void updatePositionChangesDistanceTravelled() {
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ public class LegTest {
|
||||
|
||||
GPSCoordinate startPoint = new GPSCoordinate(0, 0);
|
||||
GPSCoordinate endPoint = new GPSCoordinate(calc.getDestinationGeographicPoint().getY(), calc.getDestinationGeographicPoint().getX());
|
||||
Leg test= new Leg("Test", startPoint, endPoint, 0);
|
||||
Leg test = new Leg("Test", startPoint, endPoint, 0);
|
||||
assertEquals(test.getDistance(), 5, 1e-8);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public class LegTest {
|
||||
|
||||
GPSCoordinate startPoint = new GPSCoordinate(0, 0);
|
||||
GPSCoordinate endPoint = new GPSCoordinate(calc.getDestinationGeographicPoint().getY(), calc.getDestinationGeographicPoint().getX());
|
||||
Leg test= new Leg("Test", startPoint, endPoint, 0);
|
||||
Leg test = new Leg("Test", startPoint, endPoint, 0);
|
||||
assertEquals(test.getDistance(), 12, 1e-8);
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public class LegTest {
|
||||
|
||||
GPSCoordinate startPoint = new GPSCoordinate(0, 0);
|
||||
GPSCoordinate endPoint = new GPSCoordinate(calc.getDestinationGeographicPoint().getY(), calc.getDestinationGeographicPoint().getX());
|
||||
Leg test= new Leg("Test", startPoint, endPoint, 0);
|
||||
Leg test = new Leg("Test", startPoint, endPoint, 0);
|
||||
assertEquals(test.getDistance(), 0.5, 1e-8);
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public class LegTest {
|
||||
|
||||
GPSCoordinate startPoint = new GPSCoordinate(0, 0);
|
||||
GPSCoordinate endPoint = new GPSCoordinate(calc.getDestinationGeographicPoint().getY(), calc.getDestinationGeographicPoint().getX());
|
||||
Leg test= new Leg("Test", startPoint, endPoint, 0);
|
||||
Leg test = new Leg("Test", startPoint, endPoint, 0);
|
||||
assertEquals(test.getDistance(), 0.1, 1e-8);
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ public class LegTest {
|
||||
public void calculateDistanceHandlesZeroDifference() {
|
||||
GPSCoordinate startPoint = new GPSCoordinate(0, 0);
|
||||
GPSCoordinate endPoint = new GPSCoordinate(0, 0);
|
||||
Leg test= new Leg("Test", startPoint, endPoint, 0);
|
||||
Leg test = new Leg("Test", startPoint, endPoint, 0);
|
||||
assertEquals(test.getDistance(), 0, 1e-8);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,11 @@
|
||||
package seng302.Model;
|
||||
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.scene.paint.Color;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import seng302.GPSCoordinate;
|
||||
import seng302.Model.BoatInRace;
|
||||
import seng302.Model.ConstantVelocityRace;
|
||||
import seng302.Model.Leg;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Observable;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
Reference in New Issue
Block a user