@@ -0,0 +1,1767 @@
+package cgeo.geocaching.location;%0A%0Aimport static org.assertj.core.api.Assertions.assertThat;%0A%0Aimport cgeo.CGeoTestCase;%0Aimport cgeo.geocaching.CgeoApplication;%0A%0Aimport org.apache.commons.lang3.StringUtils;%0Aimport org.assertj.core.data.Offset;%0A%0Aimport rx.Observable;%0A%0Aimport android.location.Address;%0Aimport android.test.suitebuilder.annotation.Suppress;%0A%0Apublic class GeocoderTest extends CGeoTestCase %7B%0A%0A    private static final String TEST_ADDRESS = %2246 rue Barrault, Paris, France%22;%0A    private static final double TEST_LATITUDE = 48.82677;%0A    private static final double TEST_LONGITUDE = 2.34644;%0A    private static final Offset%3CDouble%3E TEST_OFFSET = Offset.offset(0.00010);%0A%0A    @Suppress // Some emulators don't have access to Google Android geocoder%0A    public void testAndroidGeocoder() %7B%0A        testGeocoder(new AndroidGeocoder(CgeoApplication.getInstance()).getFromLocationName(TEST_ADDRESS), %22Android%22);%0A    %7D%0A%0A    public void testGCGeocoder() %7B%0A        testGeocoder(GCGeocoder.getFromLocationName(TEST_ADDRESS), %22GC%22);%0A    %7D%0A%0A    public void testMapQuestGeocoder() %7B%0A        testGeocoder(MapQuestGeocoder.getFromLocationName(TEST_ADDRESS), %22MapQuest%22);%0A    %7D%0A%0A    public static void testGeocoder(final Observable%3CAddress%3E addressObservable, final String geocoder) %7B%0A        final Address address = addressObservable.toBlocking().first();%0A        assertThat(address.getLatitude()).as(%22latitude for %22 + geocoder + %22 geocoder%22).isCloseTo(TEST_LATITUDE, TEST_OFFSET);%0A        assertThat(address.getLongitude()).as(%22longitude for %22 + geocoder + %22 geocoder%22).isCloseTo(TEST_LONGITUDE, TEST_OFFSET);%0A        assertThat(StringUtils.lowerCase(address.getAddressLine(0))).as(%22street address for %22 + geocoder + %22 geocoder%22).startsWith(%2246 rue barrault%22);%0A    %7D%0A%0A%7D%0A

Add tests for geocoders