@ -4,6 +4,7 @@ import org.junit.Ignore;
import org.junit.Test ;
import static org.junit.Assert.assertTrue ;
import static org.testng.AssertJUnit.assertEquals ;
/ * *
* Created by esa46 on 29 / 03 / 17.
@ -29,13 +30,12 @@ public class CompoundMarkTest {
}
@Ignore
@Test
public void averageLatOfTwoMarksIsAccurate ( ) {
GPSCoordinate testCoord = new GPSCoordinate ( 10 , 0 ) ;
GPSCoordinate testCoord = new GPSCoordinate ( 0.001 , 0 ) ;
Marker testMark = new Marker ( ORIGIN_COORD , testCoord ) ;
assert True( testMark . getAverageGPSCoordinate ( ) . equals ( new GPSCoordinate ( 5 , 0 ) ) ) ;
assert Equals( testMark . getAverageGPSCoordinate ( ) , new GPSCoordinate ( 0.0005 , 0 ) ) ;
}
@Test
@ -50,10 +50,11 @@ public class CompoundMarkTest {
@Test
public void averageLatAndLongOfTwoMarksIsAccurate ( ) {
GPSCoordinate testCoord1 = new GPSCoordinate ( 1 0, 30 ) ;
GPSCoordinate testCoord2 = new GPSCoordinate ( 30 , 60 ) ;
GPSCoordinate testCoord1 = new GPSCoordinate ( 0. 0, 30 ) ;
GPSCoordinate testCoord2 = new GPSCoordinate ( 0.001 , 60 ) ;
Marker testMark = new Marker ( testCoord1 , testCoord2 ) ;
assertTrue ( testMark . getAverageGPSCoordinate ( ) . equals ( new GPSCoordinate ( 020.644102 , 44.014817 ) ) ) ;
assertEquals ( testMark . getAverageGPSCoordinate ( ) . getLatitude ( ) , 0.00051776 , 1e-8 ) ;
assertEquals ( testMark . getAverageGPSCoordinate ( ) . getLongitude ( ) , 45.000000 , 1e-8 ) ;
}
}