GPS distance tests
This commit is contained in:
parent
2585c3552a
commit
4db502c8ca
1 changed files with 39 additions and 0 deletions
39
src/test/java/fr/u_paris/gla/project/utils/GPSTest.java
Normal file
39
src/test/java/fr/u_paris/gla/project/utils/GPSTest.java
Normal file
|
@ -0,0 +1,39 @@
|
|||
package fr.u_paris.gla.project.utils;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
class GPSTest {
|
||||
|
||||
|
||||
@Test
|
||||
void distance_SameLat(){
|
||||
assertDoesNotThrow(
|
||||
() -> {
|
||||
GPS.distance(5, 3, 5, 11);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
void distance_SameLon(){
|
||||
assertDoesNotThrow(
|
||||
() -> {
|
||||
GPS.distance(5, 3, 7, 3);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
void distance_SamePoint() {
|
||||
assertEquals(0.0, GPS.distance(5, 3, 5, 3) );
|
||||
}
|
||||
|
||||
@Test
|
||||
void distance_NegativePoint(){
|
||||
assertNotEquals(0.0, GPS.distance(-5, 7, -13, 4));
|
||||
}
|
||||
|
||||
|
||||
}
|
Reference in a new issue