public void GetManufacturerPartNoTest() { try { MantechWebTools mtt = new MantechWebTools(); mtt.SetPartNumberData("65M0880-H"); string ManufacturerPN; using (IWebDriver webdriver = new FirefoxDriver()) { webdriver.Navigate().GoToUrl(mtt.Url); var wait = new WebDriverWait(webdriver, TimeSpan.FromSeconds(60)); string yourtext = webdriver.FindElement(By.TagName("body")).Text; mtt.SetPageData(webdriver.PageSource); Currency.AddExhangeRate("USD", mtt.DefDestCurrency); ManufacturerPN = mtt.GetManufacturerPartNo(); } Assert.IsTrue(ManufacturerPN == "PHSP87C54X2FBDX"); } catch (Exception ex) { Assert.Fail("Mantech GetPricingInfoTest Failed: " + ex.ToString()); } }
public void GetPricingInfoTest() { try { MantechWebTools mtt = new MantechWebTools(); mtt.SetPartNumberData("65M0880-H"); PricingInfo[] priceinfo; using (IWebDriver webdriver = new FirefoxDriver()) { webdriver.Navigate().GoToUrl(mtt.Url); var wait = new WebDriverWait(webdriver, TimeSpan.FromSeconds(60)); string yourtext = webdriver.FindElement(By.TagName("body")).Text; mtt.SetPageData(webdriver.PageSource); Currency.AddExhangeRate("USD", mtt.DefDestCurrency); priceinfo = mtt.GetPricingInfo(); } Assert.IsTrue( (priceinfo.Count() == 3) && (priceinfo[0].minqty == 1) && (priceinfo[0].maxqty == 50) && (priceinfo[0].SrcCost == 40.71) && (priceinfo[1].minqty == 51) && (priceinfo[1].maxqty == 100) && (priceinfo[1].SrcCost == 30.53) && (priceinfo[2].minqty == 101) && (priceinfo[2].maxqty == 999999) && (priceinfo[2].SrcCost == 26.46) ); } catch (Exception ex) { Assert.Fail("Mantech GetPricingInfoTest Failed: " + ex.ToString()); } }