コード例 #1
0
ファイル: ApiTests.cs プロジェクト: ericjohnolson/NadaNtd
        public void CanGetDistricts()
        {
            TaskForceApi api = new TaskForceApi();

            var result = api.GetAllDistricts("burkina faso");
            
            Assert.IsTrue(result.WasSuccessful);
        }
コード例 #2
0
 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 };
     }
 }