Merge branch 'splitIntoTwoModules' of eng-git.canterbury.ac.nz:seng302-2017/team-7 into splitIntoTwoModules

This commit is contained in:
fjc40
2017-04-28 11:22:05 +12:00
10 changed files with 121 additions and 81 deletions
@@ -1,13 +1,17 @@
package seng302.Mock;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import seng302.GPSCoordinate;
import seng302.Model.Leg;
import seng302.Model.Marker;
import java.util.List;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
/**
* Tests only work on the current version of mockXML/raceXML/raceTest.xml
@@ -72,6 +76,23 @@ public class StreamedRaceTest {
"M2",
"Gate"
};
for (int i = 0; i < legs.size(); i++) assertEquals(expectedNames[i], legs.get(i).getName());
for(int i = 0; i < legs.size(); i++) assertEquals(expectedNames[i], legs.get(i).getName());
}
/**
* raceTest.xml is not compliant with this test. Markers are positioned far out of bounds.
*/
@Test
public void markersWithinRaceBoundaries() {
GPSCoordinate topLeft = streamedCourseXMLReader.getMapTopLeft();
GPSCoordinate bottomRight = streamedCourseXMLReader.getMapBottomRight();
for(Marker marker: streamedCourseXMLReader.getMarkers()) {
GPSCoordinate centre = marker.getAverageGPSCoordinate();
assertTrue(centre.getLatitude() < bottomRight.getLatitude());
assertTrue(centre.getLatitude() > topLeft.getLatitude());
assertTrue(centre.getLongitude() > bottomRight.getLongitude());
assertTrue(centre.getLongitude() < topLeft.getLongitude());
}
}
}