Пример #1
0
        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();
        }
Пример #2
0
        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();
        }
Пример #3
0
        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));
            });
        }