示例#1
0
        public void TestCountElements()
        {
            HttpResponseMessage webResponse = DataFetcher.HttpGetSync(testUrl);

            if (webResponse.IsSuccessStatusCode)
            {
                HtmlDocument             html     = DataFetcher.ExtractHtml(webResponse);
                Dictionary <string, int> elements = DataFetcher.CountElements(html);
                Assert.IsTrue(elements.Count > 0);
                foreach (KeyValuePair <string, int> kvp in elements)
                {
                    Console.WriteLine("{0}:  {1}\n", kvp.Key, kvp.Value);
                }
            }
        }