Android Open Source - field-data-app Feature Test






From Project

Back to project page field-data-app.

License

The source code is released under:

MIT License

If you think the Android project field-data-app listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package nz.cri.gns.springs.db;
//from w ww . j av a 2 s .  co m

import org.junit.Test;

import junit.framework.TestCase;

public class FeatureTest extends TestCase {

  @Test
  public void testToTsvStringNullValue() {
    Feature feature = new Feature();
    feature.setCoordErrorEst(8.0f);
    feature.setCoordFeatureRel("In the middle");
    feature.setCoordLatitude(-37.2585246);
    feature.setCoordLongitude(176.25856);
    feature.setDescription("This is a description");
    feature.setFeatureName("Wairakei Springs");
    feature.setFeatureType("spring");
    feature.setGeothermalField(null);
    feature.setHistoricName("Ye olde Wairakei");
    
    String expected = "Wairakei Springs\tYe olde Wairakei\tspring\t\t-37.2585\t176.2586\t8\tIn the middle\tThis is a description";
    String actual = feature.toTsvString();
    assertEquals(expected, actual);
  }

  @Test
  public void testToTsvStringMultilineDescription() {
    Feature feature = new Feature();
    feature.setCoordErrorEst(8.0f);
    feature.setCoordFeatureRel("In the middle");
    feature.setCoordLatitude(-37.2585246);
    feature.setCoordLongitude(176.25856);
    feature.setDescription("This\nis\na\nmultiline\ndescription");
    feature.setFeatureName("Wairakei Springs");
    feature.setFeatureType("spring");
    feature.setGeothermalField("geo field");
    feature.setHistoricName("Ye olde Wairakei");
    
    String expected = "Wairakei Springs\tYe olde Wairakei\tspring\tgeo field\t-37.2585\t176.2586\t8\tIn the middle\tThis is a multiline description";
    String actual = feature.toTsvString();
    assertEquals(expected, actual);

  }
}




Java Source Code List

nz.cri.gns.springs.GpsLocation.java
nz.cri.gns.springs.SpringsApplication.java
nz.cri.gns.springs.activity.BioSampleActivity.java
nz.cri.gns.springs.activity.EditBiologicalSamplesActivity.java
nz.cri.gns.springs.activity.MainMenuActivity.java
nz.cri.gns.springs.activity.ManageBioSamplesActivity.java
nz.cri.gns.springs.activity.SettingsActivity.java
nz.cri.gns.springs.db.BiologicalSampleTest.java
nz.cri.gns.springs.db.BiologicalSample.java
nz.cri.gns.springs.db.ChecklistItem.java
nz.cri.gns.springs.db.Configuration.java
nz.cri.gns.springs.db.FeatureTest.java
nz.cri.gns.springs.db.Feature.java
nz.cri.gns.springs.db.PersistentObject.java
nz.cri.gns.springs.db.SpringsDbHelper.java
nz.cri.gns.springs.db.SurveyImage.java
nz.cri.gns.springs.db.SurveyTest.java
nz.cri.gns.springs.db.Survey.java
nz.cri.gns.springs.fragments.AppearanceFragment.java
nz.cri.gns.springs.fragments.BioSampleActivityFragment.java
nz.cri.gns.springs.fragments.BioSampleFragment.java
nz.cri.gns.springs.fragments.ChooseImageFragment.java
nz.cri.gns.springs.fragments.ExportSamplesFragment.java
nz.cri.gns.springs.fragments.FeatureIdFragment.java
nz.cri.gns.springs.fragments.ImageColourPickerFragment.java
nz.cri.gns.springs.fragments.ImageFragment.java
nz.cri.gns.springs.fragments.SpringsDialogFragment.java
nz.cri.gns.springs.fragments.SpringsFragment.java
nz.cri.gns.springs.util.CustomExceptionHandler.java
nz.cri.gns.springs.util.DataStatistics.java
nz.cri.gns.springs.util.DateTimePickerDialog.java
nz.cri.gns.springs.util.UiUtil.java
nz.cri.gns.springs.util.Util.java