public List<AddressLocation> FindAdresses(string addressList) { this.lastLocations.Clear(); this.ErrorMessage = String.Empty; List<Address> addresses; try { addresses = new JsonParser().ParseListOfAddress(addressList); } catch { this.ErrorMessage = @"Please provide well formatted address json array."; return this.lastLocations; } var soapClient = new AddressFinderSoapClient(); foreach (Address address in addresses) { var findAddressResponse = soapClient .findAddress(address, this.findAddressOptions, this.Token); List<AddressLocation> result = findAddressResponse.addressLocation.ToList(); if (result.Count > 0) { AddressLocation location = result.First(); this.lastLocations.Add(location); } } if(this.lastLocations.Count == 0) { this.ErrorMessage = @"Provided addresses not found."; } return this.lastLocations; }
public void BeforeEach() { subject = new JsonParser(); }