feat: coords tests
This commit is contained in:
parent
8f1e2649e1
commit
10e36d97c4
54
src/test/java/eirb/pg203/utils/CoordsTest.java
Normal file
54
src/test/java/eirb/pg203/utils/CoordsTest.java
Normal file
@ -0,0 +1,54 @@
|
||||
package eirb.pg203.utils;
|
||||
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
class CoordsTest {
|
||||
private static final float epsilon = 0.01F;
|
||||
|
||||
@Test
|
||||
void getLat() {
|
||||
float lat = 1f;
|
||||
float lon = 2f;
|
||||
Coords coords = new Coords(lat, lon);
|
||||
|
||||
Assertions.assertEquals(lat, coords.getLat(), epsilon);
|
||||
}
|
||||
|
||||
@Test
|
||||
void getLon() {
|
||||
float lat = 1f;
|
||||
float lon = 2f;
|
||||
Coords coords = new Coords(lat, lon);
|
||||
|
||||
Assertions.assertEquals(lon, coords.getLon(), epsilon);
|
||||
}
|
||||
|
||||
@Test
|
||||
void setLat() {
|
||||
float lat = 1f;
|
||||
float lon = 2f;
|
||||
Coords coords = new Coords(lat, lon);
|
||||
|
||||
float sndLat = 3f;
|
||||
coords.setLat(sndLat);
|
||||
|
||||
Assertions.assertEquals(sndLat, coords.getLat(), epsilon);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
void setLon() {
|
||||
float lat = 1f;
|
||||
float lon = 2f;
|
||||
Coords coords = new Coords(lat, lon);
|
||||
|
||||
float sndLon = 4f;
|
||||
coords.setLon(sndLon);
|
||||
|
||||
Assertions.assertEquals(sndLon, coords.getLon(), epsilon);
|
||||
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user