public void CanGetDistricts() { TaskForceApi api = new TaskForceApi(); var result = api.GetAllDistricts("burkina faso"); Assert.IsTrue(result.WasSuccessful); }
void worker_DoWork(object sender, DoWorkEventArgs e) { try { TaskForceApi api = new TaskForceApi(); e.Result = api.GetAllDistricts((string)e.Argument); } catch (Exception ex) { Logger log = new Logger(); log.Error("Error fetching country information from task force api. TaskForceCountryStep (worker_DoWork). ", ex); e.Result = new TaskForceApiResult { WasSuccessful = false, ErrorMsg = Translations.UnexpectedException + " " + ex.Message }; } }