OsmAnd/OsmAnd-java/test/java/net/osmand/search/LocationSearchTest.java
Victor Shcherb 1f3e4eaff0 Fix tests
2016-07-13 12:12:53 +02:00

29 lines
846 B
Java

package net.osmand.search;
import java.io.IOException;
import net.osmand.data.LatLon;
import net.osmand.search.SearchUICore.SearchResultMatcher;
import net.osmand.search.core.SearchCoreFactory;
import net.osmand.search.core.SearchPhrase;
import org.junit.Assert;
import org.junit.Test;
public class LocationSearchTest {
@Test
public void testBasicSearch() throws IOException {
search("5.0,3.0", new LatLon(5, 3));
}
private void search(String string, LatLon latLon) throws IOException {
SearchResultMatcher srm = new SearchUICore.SearchResultMatcher(null, 0, null, 100);
new SearchCoreFactory.SearchLocationAndUrlAPI().
search(new SearchPhrase(null).generateNewPhrase(string, null), srm);
Assert.assertEquals(srm.getRequestResults().size(), 1);
Assert.assertEquals(srm.getRequestResults().get(0).location, latLon);
}
}