Search in sources :

Example 86 with Survey

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);
}
Also used : Station(org.hwyl.sexytopo.model.survey.Station) Survey(org.hwyl.sexytopo.model.survey.Survey) Test(org.junit.Test)

Example 87 with Survey

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());
}
Also used : Survey(org.hwyl.sexytopo.model.survey.Survey) Leg(org.hwyl.sexytopo.model.survey.Leg) Test(org.junit.Test)

Example 88 with Survey

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());
}
Also used : Station(org.hwyl.sexytopo.model.survey.Station) Survey(org.hwyl.sexytopo.model.survey.Survey) Test(org.junit.Test)

Example 89 with Survey

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);
}
Also used : Station(org.hwyl.sexytopo.model.survey.Station) Survey(org.hwyl.sexytopo.model.survey.Survey) Test(org.junit.Test)

Example 90 with Survey

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);
}
Also used : Survey(org.hwyl.sexytopo.model.survey.Survey) Leg(org.hwyl.sexytopo.model.survey.Leg) Test(org.junit.Test)

Aggregations

Survey (org.hwyl.sexytopo.model.survey.Survey)101 Test (org.junit.Test)56 Station (org.hwyl.sexytopo.model.survey.Station)31 Leg (org.hwyl.sexytopo.model.survey.Leg)24 AlertDialog (android.app.AlertDialog)10 SuppressLint (android.annotation.SuppressLint)9 Coord2D (org.hwyl.sexytopo.model.graph.Coord2D)9 ArrayAdapter (android.widget.ArrayAdapter)8 File (java.io.File)6 HashMap (java.util.HashMap)6 View (android.view.View)5 EditText (android.widget.EditText)5 ArrayList (java.util.ArrayList)5 Set (java.util.Set)5 Context (android.content.Context)4 SharedPreferences (android.content.SharedPreferences)4 Editable (android.text.Editable)4 List (java.util.List)4 Map (java.util.Map)4 R (org.hwyl.sexytopo.R)4