Revision 771f38c4
Added by Andreas Müller almost 13 years ago
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/location/PointTest.java | ||
---|---|---|
127 | 127 |
|
128 | 128 |
@Test |
129 | 129 |
public void testGetLongitudeSexagesimal(){ |
130 |
Assert.assertEquals("23\u00B07'25\"E", point1.getLongitudeSexagesimal().toString(true));
|
|
130 |
Assert.assertEquals("23\u00B07'24.801\"E", point1.getLongitudeSexagesimal().toString(true, false));
|
|
131 | 131 |
|
132 | 132 |
point2.setLongitudeSexagesimal(Sexagesimal.NewInstance(5, 22, null, Direction.WEST)); |
133 |
Assert.assertTrue(point2.getLongitudeSexagesimal().minutes == 22);
|
|
134 |
Assert.assertTrue(point2.getLongitudeSexagesimal().seconds == 0);
|
|
133 |
Assert.assertEquals((Integer)22, (Integer)point2.getLongitudeSexagesimal().minutes);
|
|
134 |
Assert.assertEquals((Integer)0, (Integer)point2.getLongitudeSexagesimal().seconds);
|
|
135 | 135 |
|
136 | 136 |
Double latitudeDouble = -45.57389326; |
137 | 137 |
point1.setLatitudeSexagesimal(Sexagesimal.valueOf(latitudeDouble, true)); |
... | ... | |
209 | 209 |
* |
210 | 210 |
* @throws ParseException |
211 | 211 |
*/ |
212 |
@Ignore |
|
213 | 212 |
@Test |
214 | 213 |
public void testParsingHexagesimalAndDecimalMixed() throws ParseException{ |
215 |
String example = "-35\u00B034'55.67S";
|
|
214 |
String example = "35\u00B034'55.67\"S";
|
|
216 | 215 |
point1.setLatitudeByParsing(example); |
217 |
|
|
218 |
// should this work? |
|
219 |
Assert.assertEquals(example, point1.getLatitude()); |
|
220 |
// should this work? |
|
221 |
Assert.assertEquals(example, point1.getLatitudeSexagesimal()); |
|
216 |
Assert.assertEquals(example, point1.getLatitudeSexagesimal().toString()); |
|
222 | 217 |
} |
223 | 218 |
|
224 | 219 |
@Test |
Also available in: Unified diff
implementing decimals for seconds in Sexagesimal Points #2267