public void ReGeoRequestTest() { foreach (var location in locations) { try { var regeoResult = AMapClientUtil.ReGetGeoResult(location); } catch (Exception exp) { Assert.Fail(location + " 逆地址解析 " + exp.Message); } } }
public void GeoRequestTest() { var firstGeo = AMapClientUtil.GetGeoResult("方恒国际中心A座", "北京"); Assert.IsTrue(firstGeo.city == "北京市"); Assert.IsTrue(firstGeo.formatted_address == "北京市朝阳区方恒国际中心|A座"); Assert.IsTrue(firstGeo.province == "北京市"); Assert.IsTrue(firstGeo.citycode == "010"); Assert.IsTrue(firstGeo.district == "朝阳区"); foreach (var address in addresses) { firstGeo = AMapClientUtil.GetGeoResult(address); Assert.IsNotNull(firstGeo, address + " 不应该解析为null"); } }