Exemple #1
0
        public void QueryCoordinate_NoMatch_ReturnsNull()
        {
            var service = new GeonamesService(GetUrlReturns404);

            var queryResult = service.QueryCoordinateByPostalCode("90");

            queryResult.Should().BeNull();
        }
Exemple #2
0
        public void QueryCoordinate_MultipleMatches_ReturnsBestMatch()
        {
            var service = new GeonamesService(GetUrlReturningMultipleResults);

            var queryResult = service.QueryCoordinateByPostalCode("06773", "Gossa");

            queryResult.Should().NotBeNull();
            queryResult?.Latitude.Should().Be(51.669489);
            queryResult?.Longitude.Should().Be(12.444217);
        }
Exemple #3
0
        public void QueryCoordinate_SingleMatch_ReturnsOneEntry(string placeName)
        {
            var service = new GeonamesService(GetUrlReturningSingleResult);

            var queryResult = service.QueryCoordinateByPostalCode("91301", placeName);

            queryResult.Should().NotBeNull();
            queryResult?.Latitude.Should().Be(49.717542888321425);
            queryResult?.Longitude.Should().Be(11.058769226074219);
        }