mobilizon.chapril.org-mobil.../test/support/mocks/geospatial_mock.ex

19 lines
557 B
Elixir
Raw Permalink Normal View History

defmodule Mobilizon.Service.Geospatial.Mock do
@moduledoc """
2019-09-22 16:26:23 +02:00
Mock for Geospatial Provider implementations.
"""
2019-09-22 16:26:23 +02:00
alias Mobilizon.Addresses.Address
2019-09-22 16:26:23 +02:00
alias Mobilizon.Service.Geospatial.Provider
@behaviour Provider
@impl Provider
def geocode(_lon, _lat, _options \\ [])
def geocode(45.75, 4.85, _options), do: [%Address{description: "10 rue Jangot, Lyon"}]
def geocode(_lon, _lat, _options), do: [%Address{description: "Anywhere"}]
@impl Provider
def search(_q, _options \\ []), do: [%Address{description: "10 rue Jangot, Lyon"}]
end