Implemented Leg generation from Race.xml format
- StreamedCourse now utilises StreamedCourseXMLReader as data source #story[758]
This commit is contained in:
@@ -3,12 +3,11 @@ package seng302.Mock;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import seng302.GPSCoordinate;
|
||||
import seng302.Model.Leg;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
/**
|
||||
@@ -26,6 +25,8 @@ public class StreamedRaceTest {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
//fail("Cannot find mockXML/raceXML/raceTest.xml in the resources folder");
|
||||
} catch (StreamedCourseXMLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,9 +60,19 @@ public class StreamedRaceTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParticipants() {
|
||||
Map<Integer, StreamedBoat> participants = streamedCourseXMLReader.getParticipants();
|
||||
assertTrue(participants.containsKey(107));
|
||||
assertTrue(participants.containsKey(108));
|
||||
public void testRaceSettings() {
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void correctLegSequence() {
|
||||
List<Leg> legs = streamedCourseXMLReader.getLegs();
|
||||
String[] expectedNames = {
|
||||
"StartLine",
|
||||
"M1",
|
||||
"M2",
|
||||
"Gate"
|
||||
};
|
||||
for(int i = 0; i < legs.size(); i++) assertEquals(expectedNames[i], legs.get(i).getName());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user