Fix autocomplete coverage for Lüdenscheid.

This commit is contained in:
Andreas Schildbach 2014-02-10 10:48:27 +01:00
parent a6d8ce3d7f
commit 467299ec99
2 changed files with 22 additions and 12 deletions

View file

@ -17,12 +17,6 @@
package de.schildbach.pte;
import java.io.IOException;
import java.util.List;
import de.schildbach.pte.dto.Location;
import de.schildbach.pte.dto.LocationType;
/**
* @author Andreas Schildbach
*/
@ -49,10 +43,4 @@ public class MvgProvider extends AbstractEfaProvider
return false;
}
@Override
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
{
return xmlStopfinderRequest(new Location(LocationType.STATION, 0, null, constraint.toString()));
}
}

View file

@ -17,7 +17,9 @@
package de.schildbach.pte.live;
import static org.hamcrest.CoreMatchers.hasItem;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import java.util.Date;
@ -85,6 +87,26 @@ public class MvgProviderLiveTest extends AbstractProviderLiveTest
print(autocompletes);
}
@Test
public void autocompleteCoverage() throws Exception
{
final List<Location> luedenscheidAutocompletes = provider.autocompleteStations("Lüdenscheid Freibad");
print(luedenscheidAutocompletes);
assertThat(luedenscheidAutocompletes, hasItem(new Location(LocationType.STATION, 24200153)));
final List<Location> iserlohnAutocompletes = provider.autocompleteStations("Iserlohn Rathaus");
print(iserlohnAutocompletes);
assertThat(iserlohnAutocompletes, hasItem(new Location(LocationType.STATION, 24200764)));
final List<Location> plettenbergAutocompletes = provider.autocompleteStations("Plettenberg Friedhof");
print(plettenbergAutocompletes);
assertThat(plettenbergAutocompletes, hasItem(new Location(LocationType.STATION, 24202864)));
final List<Location> mendenAutocompletes = provider.autocompleteStations("Menden Am Gillfeld");
print(mendenAutocompletes);
assertThat(mendenAutocompletes, hasItem(new Location(LocationType.STATION, 24202193)));
}
@Test
public void shortTrip() throws Exception
{