GPS distance tests

This commit is contained in:
sakimotor 2024-03-11 17:00:43 +01:00
parent 2585c3552a
commit 4db502c8ca

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