private async Task FindPostcodeFromCoordinates() { Console.WriteLine("Find postcode from coords"); await _ukNearestPostcodeToCoordinates.Initalize(); var closestPostcode = await _ukNearestPostcodeToCoordinates.GetClosestPostcodeToCoordinate(50.796435, -1.0648767); PostcodeParts postcodeParts = new PostcodeParts(closestPostcode.Identifier, PostcodePartsType.Full); Console.WriteLine($"Neaest postcode (expect PO4 8RA) = {closestPostcode.Identifier} ({postcodeParts.GetAreaAndDistrict_10K()})"); Console.WriteLine("END Postcde match"); }
public async Task InitializeTest() { List <LocationLatLng> lookupdata = Stubs.GetPostcodeLookupData_Full(); var iProcessedUkDataMock = new Mock <IProcessedUkData>(); iProcessedUkDataMock.Setup(_ => _.GetData(It.IsAny <PostcodePartsType>()) ).ReturnsAsync(lookupdata); _cut = new UkNearestPostcodeToCoordinates(iProcessedUkDataMock.Object); await _cut.Initalize(); }