Skip to content
Snippets Groups Projects
Commit 2cf28210 authored by Rhys Evans's avatar Rhys Evans
Browse files

Added unauthorisedLocations test for future feature

parent 1e155ad9
No related branches found
No related tags found
1 merge request!40Resolve "As a user I would like to see a map containing all landmarks for a trail and a suggested path between them, so that I can easily follow the trail"
...@@ -66,6 +66,27 @@ public class LocationRepositoryTest { ...@@ -66,6 +66,27 @@ public class LocationRepositoryTest {
} assertTrue(noApporvedLeft); } assertTrue(noApporvedLeft);
} }
@Test
public void testGetAllUnapprovedLocations() {
List<Location> unapprovedLocations = locationRepository.getAllUnapprovedLocations();
List<Location> allLocations = locationRepository.getAllLocation();
for (int i=0;i<allLocations.size();i++){ // iterate over all location, removing authorised=false
for (Location app : unapprovedLocations){
if (Objects.equals(allLocations.get(i).getLocationName(), app.getLocationName())){
allLocations.remove(allLocations.get(i));
}
}
} boolean noUnapporvedLeft=false;
for (Location loc2: allLocations){
if (!loc2.isLocationApproved()){
noUnapporvedLeft=false;
break;
} else{
noUnapporvedLeft=true;
}
} assertTrue(noUnapporvedLeft);
}
@Test @Test
public void ensureApprovedLocationsAndCoordinatessAreTheSameSize(){ public void ensureApprovedLocationsAndCoordinatessAreTheSameSize(){
List<Location> approvedLocations = locationRepository.getAllApprovedLocations(); List<Location> approvedLocations = locationRepository.getAllApprovedLocations();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment