@@ -6,27 +6,30 @@ namespace Botticelli.Locations.Tests;
66
77public class ReverseGeocoderMock : IReverseGeocoder
88{
9- public async Task < GeocodeResponse > ReverseGeocode ( ReverseGeocodeRequest req )
9+ public Task < GeocodeResponse > ReverseGeocode ( ReverseGeocodeRequest req )
1010 {
11- return new GeocodeResponse
12- {
13- Latitude = req . Latitude . Value ,
14- Longitude = req . Longitude . Value ,
15- DisplayName = "TESTGEO" ,
16- Address = new AddressResult
11+ if ( req is { Latitude : not null , Longitude : not null } )
12+ return Task . FromResult < GeocodeResponse > ( new ( )
1713 {
18- Country = "TestCountry" ,
19- CountryCode = "TC0202" ,
20- County = "TestCounty" ,
21- HouseNumber = "999" ,
22- PostCode = "10291" ,
23- Road = "Abbey" ,
24- State = "NowhereState" ,
25- Town = "Nowhereville" ,
26- Pedestrian = "Sidewalk" ,
27- District = "NoDistrict" ,
28- Name = string . Empty
29- }
30- } ;
14+ Latitude = req . Latitude . Value ,
15+ Longitude = req . Longitude . Value ,
16+ DisplayName = "TESTGEO" ,
17+ Address = new AddressResult
18+ {
19+ Country = "TestCountry" ,
20+ CountryCode = "TC0202" ,
21+ County = "TestCounty" ,
22+ HouseNumber = "999" ,
23+ PostCode = "10291" ,
24+ Road = "Abbey" ,
25+ State = "NowhereState" ,
26+ Town = "NowhereVille" ,
27+ Pedestrian = "Sidewalk" ,
28+ District = "NoDistrict" ,
29+ Name = string . Empty
30+ }
31+ } ) ;
32+
33+ throw new System . InvalidOperationException ( ) ;
3134 }
3235}
0 commit comments