use of org.hwyl.sexytopo.model.survey.Survey in project sexytopo by richsmith.
the class StationNamerTest method testNameAdvancesNumberFromMiddleOfBranch.
@Test
public void testNameAdvancesNumberFromMiddleOfBranch() {
Survey testSurvey = BasicTestSurveyCreator.createStraightNorthWith2EBranch();
String newName = StationNamer.generateNextStationName(testSurvey, testSurvey.getStationByName("5"));
int numberOfStations = testSurvey.getAllStations().size();
Assert.assertEquals(Integer.toString(numberOfStations + 1), newName);
}
use of org.hwyl.sexytopo.model.survey.Survey in project sexytopo by richsmith.
the class SurveyStatsTest method testSurveyComponentCountsFromIntermediateStation.
@Test
public void testSurveyComponentCountsFromIntermediateStation() {
Survey survey = BasicTestSurveyCreator.createStraightNorthWith2EBranchFromS2();
Station subStation = survey.getStationByName("2");
Assert.assertEquals(5, SurveyStats.calcNumberSubStations(subStation));
Assert.assertEquals(4, SurveyStats.calcNumberSubLegs(subStation));
}
use of org.hwyl.sexytopo.model.survey.Survey in project sexytopo by richsmith.
the class SurveyStatsTest method testLegCountsWithSplays.
@Test
public void testLegCountsWithSplays() {
Survey survey = BasicTestSurveyCreator.createStraightNorthWith2EBranchFromS2();
Station subStation = survey.getStationByName("2");
survey.setActiveStation(subStation);
Leg leg2 = new Leg(5, 0, 0);
SurveyUpdater.update(survey, leg2);
Assert.assertEquals(5, SurveyStats.calcNumberSubStations(subStation));
Assert.assertEquals(5, SurveyStats.calcNumberSubLegs(subStation));
}
use of org.hwyl.sexytopo.model.survey.Survey in project sexytopo by richsmith.
the class OldStyleLoaderTest method testEmptySurveyResultsIn1Station.
@Test
public void testEmptySurveyResultsIn1Station() throws Exception {
String text = "";
Survey survey = new Survey("TestSurvey");
OldStyleLoader.parse(text, survey);
assert survey.getAllStations().size() == 1;
}
use of org.hwyl.sexytopo.model.survey.Survey in project sexytopo by richsmith.
the class SurveyJsonTranslaterTest method testSurveyWithTripsAreParsed.
@Test
public void testSurveyWithTripsAreParsed() throws Exception {
Survey survey = BasicTestSurveyCreator.createStraightNorthWithTrip();
String text = SurveyJsonTranslater.toText(survey, "test", 0);
Survey newSurvey = new Survey(TEST_SURVEY_NAME);
SurveyJsonTranslater.populateSurvey(survey, text);
SurveyChecker.areEqual(survey, newSurvey);
}
Aggregations