Search in sources :

Example 26 with Survey

use of org.hwyl.sexytopo.model.survey.Survey in project sexytopo by richsmith.

the class SurveyJsonTranslaterTest method testSimpleSurveyIsParsed.

@Test
public void testSimpleSurveyIsParsed() throws Exception {
    Survey survey = BasicTestSurveyCreator.createStraightNorth();
    String text = SurveyJsonTranslater.toText(survey, "test", 0);
    Survey newSurvey = new Survey(TEST_SURVEY_NAME);
    SurveyJsonTranslater.populateSurvey(survey, text);
    SurveyChecker.areEqual(survey, newSurvey);
}
Also used : Survey(org.hwyl.sexytopo.model.survey.Survey) Test(org.junit.Test)

Example 27 with Survey

use of org.hwyl.sexytopo.model.survey.Survey in project sexytopo by richsmith.

the class SurvexExporterTest method testBasicExport.

@Test
public void testBasicExport() {
    SurvexExporter survexExporter = new SurvexExporter();
    Survey oneNorth = BasicTestSurveyCreator.createStraightNorth();
    String content = survexExporter.getContent(oneNorth);
    Assert.assertTrue(content.contains("1\t2\t5.000\t0.00\t0.00"));
    Assert.assertTrue(content.contains("2\t3\t5.000\t0.00\t0.00"));
    Assert.assertTrue(content.contains("3\t4\t5.000\t0.00\t0.00"));
}
Also used : Survey(org.hwyl.sexytopo.model.survey.Survey) Test(org.junit.Test)

Example 28 with Survey

use of org.hwyl.sexytopo.model.survey.Survey in project sexytopo by richsmith.

the class SurvexExporterTest method testCommentsAreIncluded.

@Test
public void testCommentsAreIncluded() {
    SurvexExporter survexExporter = new SurvexExporter();
    Survey oneNorth = BasicTestSurveyCreator.createStraightNorthThroughRepeats();
    Station latest = oneNorth.getActiveStation();
    String testComment = "Comment McComment Face";
    latest.setComment(testComment);
    String content = survexExporter.getContent(oneNorth);
    Assert.assertTrue(content.contains(testComment));
}
Also used : Station(org.hwyl.sexytopo.model.survey.Station) Survey(org.hwyl.sexytopo.model.survey.Survey) Test(org.junit.Test)

Example 29 with Survey

use of org.hwyl.sexytopo.model.survey.Survey in project sexytopo by richsmith.

the class TherionImporterTest method testElevationDirectionExtraction.

@Test
public void testElevationDirectionExtraction() throws Exception {
    Survey survey = new Survey("Test");
    TherionImporter.updateCentreline(LINES, survey);
    Station stationTwo = survey.getStationByName("2");
    Direction stationTwoDirection = stationTwo.getExtendedElevationDirection();
    Assert.assertEquals(Direction.LEFT, stationTwoDirection);
    Station stationThree = survey.getStationByName("3");
    Direction stationThreeDirection = stationThree.getExtendedElevationDirection();
    Assert.assertEquals(Direction.LEFT, stationThreeDirection);
    Station stationFive = survey.getStationByName("5");
    Direction stationFiveDirection = stationFive.getExtendedElevationDirection();
    Assert.assertEquals(Direction.RIGHT, stationFiveDirection);
}
Also used : Station(org.hwyl.sexytopo.model.survey.Station) Survey(org.hwyl.sexytopo.model.survey.Survey) Direction(org.hwyl.sexytopo.model.graph.Direction) Test(org.junit.Test)

Example 30 with Survey

use of org.hwyl.sexytopo.model.survey.Survey in project sexytopo by richsmith.

the class OldStyleLoaderTest method testSimpleSurveyIsParsed.

@Test
public void testSimpleSurveyIsParsed() throws Exception {
    String text = "1\t2\t9.11\t121\t-23\n";
    Survey survey = new Survey("TestSurvey");
    OldStyleLoader.parse(text, survey);
    assert survey.getAllStations().size() == 2;
    assert survey.getOrigin().getConnectedOnwardLegs().get(0).getDestination().getName().equals("2");
}
Also used : Survey(org.hwyl.sexytopo.model.survey.Survey) 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