public void ChangeRegion_MustReturnRegionNotFoundException() { IBrowserService browserService = new BrowserService(); var regionChangeService = new RegionChangeService(browserService); Assert.ThrowsException <RegionNotFoundException>(() => regionChangeService.ChangeRegion("monako")); browserService.Browser.Close(); browserService.Browser.Dispose(); }
public void ChangeRegion_MustChangeRegionInMVideoSite() { IBrowserService browserService = new BrowserService(); var regionChangeService = new RegionChangeService(browserService); regionChangeService.ChangeRegion("Екатеринбург"); Assert.AreEqual(browserService.Browser.FindElement(HomePageProperties.LocationText).Text, "Екатеринбург"); browserService.Browser.Close(); browserService.Browser.Dispose(); }
static void Main(string[] args) { ILogger logger = new Logger(); IBrowserService browserService = new BrowserPoolService(); IConvertService convertService = new ConvertService(); IDocumentService documentService = new DocumentService(); IXmlReadService xmlReadService = new XmlReadService(); IProductsPageParseService productsPageParseService = new ProductsPageParseService(logger, browserService, convertService); IRegionChangeService regionChangeService = new RegionChangeService(browserService); regionChangeService.ChangeRegion(ConfigurationManager.AppSettings["regionname"]); convertService.GetUniqCategoriesFromSiteMap(convertService.WriteSiteMapFromXml(xmlReadService.DownloadXml())).ToList().ForEach(c => { documentService.WriteProductsInExcel(logger, productsPageParseService.GetProducts(c.loc), convertService.GetSafeFilename(c.loc)); }); }