Skip to content
Snippets Groups Projects
Commit 453aacfb authored by Hallvard Trætteberg's avatar Hallvard Trætteberg
Browse files

Added test for removal of existing location.

parent 1a0f91f9
No related branches found
No related tags found
No related merge requests found
......@@ -71,4 +71,18 @@ public class GeoLocationsTest {
LatLong nearestlocations = geoLocations.findNearestLocation(latLong);
Assert.assertEquals(latLong, nearestlocations);
}
@Test
public void testRemoveSameLocations() {
GeoLocations geoLocations1 = new GeoLocations(new LatLong(0, 0), new LatLong(1, 1));
Assert.assertEquals(2, geoLocations1.size());
geoLocations1.removeLocations(new LatLong(0, 0), 0.0);
Assert.assertEquals(1, geoLocations1.size());
geoLocations1.removeLocations(new LatLong(1, 1), 0.0);
Assert.assertEquals(0, geoLocations1.size());
GeoLocations geoLocations2 = new GeoLocations(new LatLong(0, 0), new LatLong(0, 0));
Assert.assertEquals(2, geoLocations2.size());
geoLocations2.removeLocations(new LatLong(0, 0), 0.0);
Assert.assertEquals(0, geoLocations2.size());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment