Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Test
- public void isUserFinishedTrip() throws Exception {
- Location location = new Location("Target");
- location.setLatitude(55.689681);
- location.setLongitude(22.322333);
- CircleGeofence.targetLocation = location;
- assertEquals(true, CircleGeofence.isUserFinishedTrip(location));
- }
- Klasių „LakeLayerGeofence.java“ metodai:
- @Test
- public void isUserInLake() throws Exception {
- ArrayList<LatLong> latLongs = new ArrayList<>();
- latLongs.add(new LatLong(54.907584, 23.838378));
- latLongs.add(new LatLong(54.893736, 23.822805));
- latLongs.add(new LatLong(54.873623, 23.815401));
- latLongs.add(new LatLong(54.841551, 23.928823));
- latLongs.add(new LatLong(54.882190, 23.989455));
- latLongs.add(new LatLong(54.941970, 24.011399));
- assertEquals(true, geofence.isUserInLake(latLongs, 54.841551, 23.928823));
- }
- @Test
- public void isUserCollidesWithIsland() throws Exception {
- ArrayList<LatLong> latLongs = new ArrayList<>();
- latLongs.add(new LatLong(54.907584, 23.838378));
- latLongs.add(new LatLong(54.893736, 23.822805));
- latLongs.add(new LatLong(54.873623, 23.815401));
- latLongs.add(new LatLong(54.841551, 23.928823));
- latLongs.add(new LatLong(54.882190, 23.989455));
- latLongs.add(new LatLong(54.941970, 24.011399));
- assertEquals(false, geofence.isUserCollidesWithIsland(latLongs, 54.841551, 23.928823));
- }
- Šios klasės testavimo metodas parodo ar dabartinis laikas nepatenka į nurodytą intervalą
- @Test
- public void canFish() throws Exception {
- Calendar calendar = Calendar.getInstance();
- FishWarning fishWarning = new FishWarning();
- assertEquals(false, fishWarning.canFish(calendar, 5, 14, 12, 15));
- }
- Šios klasės testavimo metodas patikrina grąžintą normalizacijos laipsnį
- @Test
- public void normalizeDegree() throws Exception {
- float expDegree = 550;
- Compass compass = new Compass();
- float result = compass.normalizeDegree(190);
- assertEquals(0, expDegree, result);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement