public void GetCorpIndustryJobsTest() { IndustryJobList jobList = EveApi.GetIndustryJobList(IndustryJobListType.Corporation, 432435, 234523, "fullApiKey"); Assert.AreEqual(22, jobList.IndustryJobListItems.Length); Assert.AreEqual(444, jobList.IndustryJobListItems[0].JobId); Assert.AreEqual(60010783, jobList.IndustryJobListItems[0].ContainerId); Assert.AreEqual(60010783, jobList.IndustryJobListItems[0].InstalledItemLocationId); }
public static void IndustryJobListExample() { IndustryJobList ijl = EveApi.GetIndustryJobList(IndustryJobListType.Corporation, 1234, 5678, "fullApiKey"); foreach (IndustryJobList.IndustryJobListItem item in ijl.IndustryJobListItems) { if (item.Completed) { Console.WriteLine("Completed JobId: {0} Installed at location: {1}", item.JobId, item.InstalledItemLocationId); } } }
private Dictionary <string, List <IndustryJobList.IndustryJobListItem> > getCorpsJobsForUser(User user) { Iesi.Collections.Generic.ISet <UserApi> apis = user.apis; Dictionary <string, List <IndustryJobList.IndustryJobListItem> > corpJobs = new Dictionary <string, List <IndustryJobList.IndustryJobListItem> >(); foreach (UserApi api in apis) { foreach (Character character in api.characters) { try { List <IndustryJobList.IndustryJobListItem> industryJobs = new List <IndustryJobList.IndustryJobListItem>(); String corp = EveApi.GetCorporationSheet(api.apiUserId, character.apiCharacterId, api.apiKeyId).CorporationName; if (corpJobs.ContainsKey(corp)) { continue; } IndustryJobList jobs = EveApi.GetIndustryJobList(IndustryJobListType.Corporation, api.apiUserId, character.apiCharacterId, api.apiKeyId); foreach (IndustryJobList.IndustryJobListItem job in jobs.IndustryJobListItems) { if (job.EndProductionTimeLocal > DateTime.Now) { industryJobs.Add(job); } } corpJobs.Add(corp, industryJobs); } catch (System.Net.WebException webException) { //Probably a 403, but we should refine this a bit. log.Debug("Got a" + webException.GetType().ToString() + " when trying to get " + character.characterName + "'s corp job sheet."); } catch (Exception e) { log.Warn(e); } } } return(corpJobs); }
public void IndustryJobsPersist() { ResponseCache.Clear(); IndustryJobList industryJobList = EveApi.GetIndustryJobList(IndustryJobListType.Corporation, 432435, 346, "apiKey"); ResponseCache.Save("ResponseCache.xml"); ResponseCache.Clear(); ResponseCache.Load("ResponseCache.xml"); IndustryJobList cachedIndustryJobList = EveApi.GetIndustryJobList(IndustryJobListType.Corporation, 432435, 346, "apiKey"); Assert.AreEqual(industryJobList.CachedUntilLocal, cachedIndustryJobList.CachedUntilLocal); for (int i = 0; i < industryJobList.IndustryJobListItems.Length; i++) { Assert.AreEqual(industryJobList.IndustryJobListItems[i].JobId, cachedIndustryJobList.IndustryJobListItems[i].JobId); Assert.AreEqual(industryJobList.IndustryJobListItems[i].AssemblyLineId, cachedIndustryJobList.IndustryJobListItems[i].AssemblyLineId); Assert.AreEqual(industryJobList.IndustryJobListItems[i].Completed, cachedIndustryJobList.IndustryJobListItems[i].Completed); } }