public void UploadMappingFile() { if (!AtomTestSettings.EnableWinQualUploadFileTests) { return; } AtomFeed atomFeed = new AtomFeed(null, 1, 100000, false, true, null, 11); // ATOM LOGIN. Assert.AreEqual(true, atomFeed.Login(TestSettings.WinQualUserName, TestSettings.WinQualPassword)); try { atomFeed.UploadFile(@"R:\stackhash\BusinessLogic\BusinessLogic\TestData\MappingFiles\1.0.4511.261.xml"); } finally { try { atomFeed.LogOut(); } catch { } } }
public void GetProducts() { if (!AtomTestSettings.EnableWinQualProductTests) { return; } AtomFeed atomFeed = new AtomFeed(null, 1, 100000, false, true, null, 11); // ATOM LOGIN. Assert.AreEqual(true, atomFeed.Login(TestSettings.WinQualUserName, TestSettings.WinQualPassword)); try { AtomProductCollection products = atomFeed.GetProducts(); Assert.AreEqual(true, products.Count > 0); Assert.AreEqual(true, products.DateFeedUpdated < DateTime.Now); } finally { try { atomFeed.LogOut(); } catch { } } }
public void GetFiles() { if (!AtomTestSettings.EnableWinQualFilesTests) { return; } 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(); foreach (AtomProduct atomProduct in atomProducts) { AtomFileCollection files = atomFeed.GetFiles(atomProduct); Assert.AreEqual(true, files.Count > 0); } } finally { try { atomFeed.LogOut(); } catch { } } }
public void GetCabs() { if (!AtomTestSettings.EnableWinQualCabDownloadTests) { return; } DateTime startTime = DateTime.Now.AddDays(-89); 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 foundCab = 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) { AtomCabCollection eventCabs = atomFeed.GetCabs(atomEvent); foreach (AtomCab eventCab in eventCabs) { Assert.AreEqual(true, eventCab.Cab.DateCreatedLocal < DateTime.Now); foundCab = true; } if (foundCab) { return; } } } } Assert.AreEqual(true, false); // Should get here. } finally { try { atomFeed.LogOut(); } catch { } } }
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 void GetProductsCalls24Hours() { if (!AtomTestSettings.EnableWinQualProductTests) { return; } AtomFeed atomFeed = new AtomFeed(null, 10, 100000, false, true, null, 11); // ATOM LOGIN. Assert.AreEqual(true, atomFeed.Login(TestSettings.WinQualUserName, TestSettings.WinQualPassword)); int count = 0; DateTime startTime = DateTime.Now; try { Console.WriteLine("StartTime = " + startTime.ToString()); while (true) { count++; Console.WriteLine("Count: " + count.ToString()); AtomProductCollection products = atomFeed.GetProducts(); Assert.AreEqual(true, products.Count > 10); // Wait for 15 mins before retrying. Thread.Sleep(15 * 60 * 1000); } } catch (System.Exception ex) { DateTime endTime = DateTime.Now; Console.WriteLine("Crashed " + ex.ToString()); } finally { try { atomFeed.LogOut(); } catch { } } }
public void GetEvents() { if (!AtomTestSettings.EnableWinQualEventsTests) { return; } AtomFeed atomFeed = new AtomFeed(null, 1, 100000, false, true, null, 11); Assert.AreEqual(true, atomFeed.Login(TestSettings.WinQualUserName, TestSettings.WinQualPassword)); try { AtomProductCollection atomProducts = atomFeed.GetProducts(); int totalEvents = 0; // Just keep going until one set of events has been found. foreach (AtomProduct atomProduct in atomProducts) { // ATOM GetFiles. AtomFileCollection atomFiles = atomFeed.GetFiles(atomProduct); foreach (AtomFile atomFile in atomFiles) { AtomEventCollection atomEvents = atomFeed.GetEvents(atomFile, DateTime.Now.AddDays(-89)); foreach (AtomEvent atomEvent in atomEvents) { Assert.AreEqual(true, atomEvent.Event.Id != 0); totalEvents++; } if (totalEvents > 0) { return; } } } } finally { try { atomFeed.LogOut(); } catch { } } }
public void LogonWithGoodCredentials() { if (!AtomTestSettings.EnableWinQualLogOnTests) { return; } // Define the certificate policy for the application. ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(MyCertificateValidation.ValidateServerCertificate); AtomFeed atomFeed = new AtomFeed(null, 1, 100000, false, true, null, 11); Assert.AreEqual(true, atomFeed.Login(TestSettings.WinQualUserName, TestSettings.WinQualPassword)); atomFeed.LogOut(); }
public void DownloadCab() { if (!AtomTestSettings.EnableWinQualCabDownloadTests) { return; } DateTime startTime = DateTime.Now.AddDays(-89); 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 foundCab = 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) { AtomCabCollection atomCabs = atomFeed.GetCabs(atomEvent); foreach (AtomCab atomCab in atomCabs) { Assert.AreEqual(true, atomCab.Cab.DateCreatedLocal < DateTime.Now); String tempFolder = Path.GetTempPath(); String fileName = atomFeed.DownloadCab(atomCab, true, tempFolder); try { Assert.AreEqual(true, File.Exists(fileName)); FileInfo fileInfo = new FileInfo(fileName); Assert.AreEqual(atomCab.Cab.SizeInBytes, fileInfo.Length); } finally { if (File.Exists(fileName)) { File.Delete(fileName); } } foundCab = true; } if (foundCab) { return; } } } } Assert.AreEqual(true, false); // Should get here. } finally { try { atomFeed.LogOut(); } catch { } } }