Testing PDOK.nl Geocoding Implementation in alexreisner/geocoder
This test suite validates the PDOK.nl geocoding service integration within the Geocoder gem, focusing on address component parsing and location data accuracy for Dutch addresses. The tests ensure proper handling of address details and coordinate mapping.
Test Coverage Overview
Implementation Analysis
Technical Details
Best Practices Demonstrated
alexreisner/geocoder
test/unit/lookups/pdok_nl_test.rb
# encoding: utf-8
require 'test_helper'
class PdokNlTest < GeocoderTestCase
def setup
super
Geocoder.configure(lookup: :pdok_nl)
end
def test_result_components
result = Geocoder.search('Nieuwezijds Voorburgwal 147, Amsterdam').first
assert_equal result.street, 'Nieuwezijds Voorburgwal'
assert_equal result.street_number, '147'
assert_equal result.city, 'Amsterdam'
assert_equal result.postal_code, '1012RJ'
assert_equal result.address, 'Nieuwezijds Voorburgwal 147, 1012RJ Amsterdam'
assert_equal result.province, 'Noord-Holland'
assert_equal result.province_code, 'PV27'
assert_equal result.country_code, 'NL'
assert_equal result.latitude, 52.37316398
assert_equal result.longitude, 4.89089949
end
end