示例#1
0
        public void BrowseStoreTest()
        {
            StoreBrowser target = new StoreBrowser(); // TODO: Initialize to an appropriate value
            Parser parser = new  VerkkokauppaParser();
              var store = new Store() {MainPageUrl = "http://www.verkkokauppa.com", Name = "Verkkokauppa"};

            target.BrowseStore(parser,store );
        }
        public void ParseProductPageTest()
        {
            VerkkokauppaParser target = new VerkkokauppaParser();
              HtmlDocument result = new HtmlDocument();
              result.Load("verkkokauppa_product.htm");
              target.ProductParsed += new EventHandler<ParserEventArgs>(target_ProductParsed);

              target.ParseProductPage(result, "TestiKategoria");
        }
        public void ParseMainpageTest()
        {
            VerkkokauppaParser target = new VerkkokauppaParser();
              HtmlDocument document = new HtmlDocument();
              target.FoundCategory += new EventHandler<DataAcquisition.Parsers.ParserEventArgs>(target_FoundCategory);
              document.Load("verkkokauppa.htm");
              target.ParseMainpage(document);

              Assert.IsTrue(categoryCount == 8);
        }
        public void ParsePage_product_list_found_test()
        {
            VerkkokauppaParser target = new VerkkokauppaParser();
              HtmlDocument result = new HtmlDocument();
              result.Load("productlist.htm");
              string parentCategory = "Pelikuullokkeet";
              target.FoundProductLink += new EventHandler<ParserEventArgs>(target_FoundProductLink);

              target.ParseCategoryPage(result, parentCategory);
              Assert.IsTrue(productCount > 10);
        }