public void PlacePathTest(double latitude, double longitude, string placeName) { IReverseGeocoder geocoder = new ReverseGeocoder(CitiesDbPath); var place = geocoder.GetNearestPlace(latitude, longitude); Assert.NotNull(place); Assert.AreEqual(placeName, place.Name); }
public void PlaceStreamTest(double latitude, double longitude, string placeName) { using (var fileStream = File.OpenRead(CitiesDbPath)) { IReverseGeocoder geocoder = new ReverseGeocoder(fileStream); var place = geocoder.GetNearestPlace(latitude, longitude); Assert.NotNull(place); Assert.AreEqual(placeName, place.Name); } }
public void CountryDbTest(double latitude, double longitude, string placeName, string countryName) { var geoDb = new GeoDb(CitiesDbPath, CountresDbPath); IReverseGeocoder geocoder = new ReverseGeocoder(geoDb); var place = geocoder.GetNearestPlace(latitude, longitude); Assert.NotNull(place); Assert.AreEqual(placeName, place.Name); Assert.NotNull(place.CountryInfo); Assert.AreEqual(countryName, place.CountryInfo.Country); }
public void CountryStreamTest(double latitude, double longitude, string placeName, string countryName) { using (var fileStreamCities = File.OpenRead(CitiesDbPath)) using (var fileStreamCountries = File.OpenRead(CountresDbPath)) { IReverseGeocoder geocoder = new ReverseGeocoder(fileStreamCities, fileStreamCountries); var place = geocoder.GetNearestPlace(latitude, longitude); Assert.NotNull(place); Assert.AreEqual(placeName, place.Name); Assert.NotNull(place.CountryInfo); Assert.AreEqual(countryName, place.CountryInfo.Country); } }
public void OddCoordinatesTest(double latitude, double longitude) { IReverseGeocoder geocoder = new ReverseGeocoder(CitiesDbPath); Assert.DoesNotThrow(() => geocoder.GetNearestPlace(latitude, longitude)); }