public async Task<string> geocode(IList<string> places) { Dictionary<string,string> qs = new Dictionary<string,string>(); qs.Add("places", string.Join(",", places)); return (await ProcessUrlAsync("geocode.json", qs)); }
public async Task geocode() { Loklak loklak = new Loklak(); var p = new List<string>(); p.Add("Delhi"); p.Add("Berlin"); var result = await loklak.geocode(p); var d = JObject.Parse(result); Assert.IsNotNull(d.Property("locations")); Assert.AreEqual(((JObject)(((JObject)d.GetValue("locations")).GetValue("Delhi"))).GetValue("country_code").ToString(),"IN"); Assert.AreEqual(((JObject)(((JObject)d.GetValue("locations")).GetValue("Berlin"))).GetValue("country_code").ToString(), "DE"); }