use of org.hwyl.sexytopo.model.survey.Survey in project sexytopo by richsmith.
the class CrossSectionerTest method testStraightSouthCrossSection.
@Test
public void testStraightSouthCrossSection() {
Survey testSurvey = BasicTestSurveyCreator.createStraightSouth();
Station s2 = testSurvey.getStationByName("2");
double angle = CrossSectioner.getAngleOfSection(testSurvey, s2);
Assert.assertEquals(180.0, angle, SexyTopo.ALLOWED_DOUBLE_DELTA);
}
use of org.hwyl.sexytopo.model.survey.Survey in project sexytopo by richsmith.
the class GraphToListTranslatorTest method testChronoListGeneration.
@Test
public void testChronoListGeneration() {
GraphToListTranslator translator = new GraphToListTranslator();
Survey baseSurvey = BasicTestSurveyCreator.createStraightNorth();
baseSurvey.setActiveStation(baseSurvey.getStationByName("1"));
SurveyUpdater.updateWithNewStation(baseSurvey, new Leg(5, 270, 0));
List<GraphToListTranslator.SurveyListEntry> chronoList = translator.toChronoListOfSurveyListEntries(baseSurvey);
GraphToListTranslator.SurveyListEntry last = chronoList.get(chronoList.size() - 1);
Assert.assertEquals("5", last.getLeg().getDestination().getName());
}
use of org.hwyl.sexytopo.model.survey.Survey in project sexytopo by richsmith.
the class StationRenameTest method testRenameOriginStation.
@Test
public void testRenameOriginStation() {
Survey testSurvey = BasicTestSurveyCreator.createStraightNorth();
Station s1 = testSurvey.getStationByName("1");
SurveyUpdater.renameStation(testSurvey, s1, "ShinyNewNameOrigin");
Station shinyNewStation = testSurvey.getStationByName("ShinyNewNameOrigin");
Assert.assertEquals("ShinyNewNameOrigin", shinyNewStation.getName());
}
use of org.hwyl.sexytopo.model.survey.Survey in project sexytopo by richsmith.
the class StationRenameTest method testGetStationByNameCanFail.
@Test
public void testGetStationByNameCanFail() {
Survey testSurvey = BasicTestSurveyCreator.createStraightNorth();
Station shouldBeNull = testSurvey.getStationByName("I DO NOT EXIST :P");
Assert.assertNull(shouldBeNull);
}
use of org.hwyl.sexytopo.model.survey.Survey in project sexytopo by richsmith.
the class SurveyUpdaterTest method testEditLegWorks.
@Test
public void testEditLegWorks() {
Leg leg = new Leg(5, 0, 0);
Survey survey = new Survey("Test Survey");
SurveyUpdater.update(survey, leg);
Leg newEdit = new Leg(6, 0, 0);
SurveyUpdater.editLeg(survey, leg, newEdit);
Assert.assertEquals(survey.getAllLegs().size(), 1);
Assert.assertEquals(survey.getAllLegs().get(0).getDistance(), 6, ALLOWED_DOUBLE_DELTA);
}
Aggregations