public async void GetProductsStartingWithMol()
 {
     LivePageRetrieverFactory factory = new LivePageRetrieverFactory();
     var productNamesRetriever = factory.ProductNamesPageRetriever;
     var page = await productNamesRetriever.RetrievePageXml("Mol");
     var xmlText = page.ToString();
     Assert.That(xmlText, Is.StringContaining("MOLSON CANADIAN"));
 }
 public async void GetAllStoresXml()
 {
     LivePageRetrieverFactory factory = new LivePageRetrieverFactory();
     var storeListPageRetriever = factory.StoreListPageRetriever;
     var page = await storeListPageRetriever.RetrievePageXml(String.Empty);
     var xmlText = page.ToString();
     Assert.That(xmlText, Is.StringContaining("YONGE & DUNDAS"));
 }
 public async void GetMolsonCanadian473Can()
 {
     LivePageRetrieverFactory factory = new LivePageRetrieverFactory();
     var productPageRetriever = factory.ProductDetailsPageRetriever;
     var page = await productPageRetriever.RetrievePageHtml("904409");
     Assert.That(page.DocumentNode.FirstChild, Is.InstanceOf<HtmlAgilityPack.HtmlCommentNode>());
     Assert.That(page.DocumentNode.FirstChild.InnerHtml, Is.StringStarting("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">"));
     Assert.That(page.DocumentNode.InnerHtml, Is.StringContaining("MOLSON CANADIAN"));
 }
 public async void GetStore568()
 {
     LivePageRetrieverFactory factory = new LivePageRetrieverFactory();
     var storePageRetriever = factory.StoreDetailsPageRetriever;
     var page = await storePageRetriever.RetrievePageHtml("568");
     Assert.That(page.DocumentNode.FirstChild, Is.InstanceOf<HtmlAgilityPack.HtmlCommentNode>());
     Assert.That(page.DocumentNode.FirstChild.InnerHtml, Is.StringStarting("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">"));
     Assert.That(page.DocumentNode.InnerHtml, Is.StringContaining("YONGE & DUNDAS"));
 }
 public async void GetAllProducts()
 {
     LivePageRetrieverFactory factory = new LivePageRetrieverFactory();
     var productListPageRetriever = factory.ProductListPageRetriever;
     var page = await productListPageRetriever.RetrievePageHtml(String.Empty);
     Assert.That(page.DocumentNode.FirstChild, Is.InstanceOf<HtmlAgilityPack.HtmlCommentNode>());
     Assert.That(page.DocumentNode.FirstChild.InnerHtml, Is.StringStarting("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">"));
     Assert.That(page.DocumentNode.InnerHtml, Is.StringContaining("MOLSON CANADIAN"));
     Assert.That(page.DocumentNode.InnerHtml, Is.StringContaining("CHIMAY PREMIER"));
 }
 public void GetMolsonCanadianInventory()
 {
     LivePageRetrieverFactory factory = new LivePageRetrieverFactory();
     var inventoryPageRetriever = factory.InventoryPageRetriever;
     var task = inventoryPageRetriever.RetrievePageHtml("904409");
     task.Wait();
     var page = task.Result;
     Assert.That(page.DocumentNode.FirstChild, Is.InstanceOf<HtmlAgilityPack.HtmlCommentNode>());
     Assert.That(page.DocumentNode.FirstChild.InnerHtml, Is.StringStarting("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">"));
     Assert.That(page.DocumentNode.InnerHtml, Is.StringContaining("MOLSON CANADIAN"));
     Assert.That(page.DocumentNode.InnerHtml, Is.StringContaining("YONGE & DUNDAS"));
 }
        public async void GetAFewProducts()
        {
            LivePageRetrieverFactory factory = new LivePageRetrieverFactory();
            var productPageRetriever = factory.ProductDetailsPageRetriever;

            var pages = await productPageRetriever.RetrievePageHtmlsAsync(new List<int> { 904409, 198069 });
            Assert.That(pages.Length, Is.EqualTo(2));
            var result0 = pages[0];
            var result1 = pages[1];
            Assert.That(result0.DocumentNode.FirstChild, Is.InstanceOf<HtmlAgilityPack.HtmlCommentNode>());
            Assert.That(result0.DocumentNode.FirstChild.InnerHtml, Is.StringStarting("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">"));
            Assert.That(result0.DocumentNode.InnerHtml, Is.StringContaining("MOLSON CANADIAN"));

            Assert.That(result1.DocumentNode.FirstChild, Is.InstanceOf<HtmlAgilityPack.HtmlCommentNode>());
            Assert.That(result1.DocumentNode.FirstChild.InnerHtml, Is.StringStarting("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">"));
            Assert.That(result1.DocumentNode.InnerHtml, Is.StringContaining("CHIMAY PREMIER"));
        }
        public async void GetAFewStores()
        {
            LivePageRetrieverFactory factory = new LivePageRetrieverFactory();
            var storePageRetriever = factory.StoreDetailsPageRetriever;

            var pages = await storePageRetriever.RetrievePageHtmlsAsync(new List<int> { 568, 496, 333, 411, 483, 148, 17, 614, 12, 511, 677, 528, 217, 512, 639, 10, 15, 4, 532, 3 });
            Assert.That(pages.Length, Is.EqualTo(20));
            var result0 = pages[0];
            var result1 = pages[1];
            Assert.That(result0.DocumentNode.FirstChild, Is.InstanceOf<HtmlAgilityPack.HtmlCommentNode>());
            Assert.That(result0.DocumentNode.FirstChild.InnerHtml, Is.StringStarting("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">"));
            Assert.That(result0.DocumentNode.InnerHtml, Is.StringContaining("YONGE & DUNDAS"));

            Assert.That(result1.DocumentNode.FirstChild, Is.InstanceOf<HtmlAgilityPack.HtmlCommentNode>());
            Assert.That(result1.DocumentNode.FirstChild.InnerHtml, Is.StringStarting("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">"));
            Assert.That(result1.DocumentNode.InnerHtml, Is.StringContaining("RICHMOND"));
        }