use of org.hwyl.sexytopo.model.survey.Station 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.Station 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.Station in project sexytopo by richsmith.
the class SurveyUpdaterTest method testMoveLegWorks.
@Test
public void testMoveLegWorks() {
Survey survey = BasicTestSurveyCreator.createStraightNorth();
Leg toMove = survey.getStationByName("2").getOnwardLegs().get(0);
Station originatingStation = survey.getOriginatingStation(toMove);
Station destinationStation = survey.getStationByName("1");
Assert.assertNotEquals(originatingStation, destinationStation);
SurveyUpdater.moveLeg(survey, toMove, destinationStation);
Assert.assertTrue(destinationStation.getOnwardLegs().contains(toMove));
Assert.assertFalse(originatingStation.getOnwardLegs().contains(toMove));
}
use of org.hwyl.sexytopo.model.survey.Station 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.Station 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));
}
Aggregations