Search in sources :

Example 96 with Survey

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

Example 97 with Survey

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

Example 98 with Survey

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

Example 99 with Survey

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

Example 100 with Survey

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);
}
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