public void GetEventInfos() { if (!AtomTestSettings.EnableWinQualEventsTests) { return; } DateTime startTime = DateTime.Now.AddMonths(-1); AtomFeed atomFeed = new AtomFeed(null, 1, 100000, false, true, null, 11); Assert.AreEqual(true, atomFeed.Login(TestSettings.WinQualUserName, TestSettings.WinQualPassword)); try { // ATOM GetProducts. AtomProductCollection atomProducts = atomFeed.GetProducts(); bool foundAnEventInfo = false; foreach (AtomProduct atomProduct in atomProducts) { AtomFileCollection atomFiles = atomFeed.GetFiles(atomProduct); foreach (AtomFile atomFile in atomFiles) { AtomEventCollection atomEvents = atomFeed.GetEvents(atomFile, startTime); foreach (AtomEvent atomEvent in atomEvents) { AtomEventInfoCollection eventInfos = atomFeed.GetEventDetails(atomEvent, 89); foreach (AtomEventInfo eventInfo in eventInfos) { Assert.AreEqual(true, eventInfo.EventInfo.DateCreatedLocal < DateTime.Now); foundAnEventInfo = true; } if (foundAnEventInfo) { return; } } } } Assert.AreEqual(true, false); // Should get here. } finally { try { atomFeed.LogOut(); } catch { } } }
public static StackHashEventInfoCollection GetEventInfoAtom(AtomFeed feed, AtomEvent theEvent, int days) { // Get the list of events. AtomEventInfoCollection atomEventInfos = feed.GetEventDetails(theEvent, days); // Convert to a StackHashEventInfoCollection. StackHashEventInfoCollection atomStackHashEventInfos = new StackHashEventInfoCollection(); foreach (AtomEventInfo atomEventInfo in atomEventInfos) { atomStackHashEventInfos.Add(atomEventInfo.EventInfo); } return(atomStackHashEventInfos); }