コード例 #1
0
        public void TestClubParsing()
        {
            string           url    = @"file://C:\Transfermarkt\Performance\club.html";
            IDomain <IValue> domain = null;

            List <long> ellapsedMillis = new List <long>();

            for (int i = 0; i < 20; i++)
            {
                ClubPage page = new ClubPage(new HAPConnection(), logger);

                var watch = System.Diagnostics.Stopwatch.StartNew();
                page.Parse(url);
                watch.Stop();
                ellapsedMillis.Add(watch.ElapsedMilliseconds);

                domain = page.Domain;
            }

            Assert.IsNotNull(domain, "The returned Domain is null.");

            TestingConfigs.DomainElementsCheck(domain);
            for (int i = 0; i < domain.Children.Count; i++)
            {
                TestingConfigs.DomainElementsCheck(domain.Children[i]);
            }

            // Log only if the checks passed.
            Log(ellapsedMillis);
        }
コード例 #2
0
        public void TestClubParsing()
        {
            string url = "https://www.transfermarkt.pt/fc-barcelona/kader/verein/131/plus/1/galerie/0?saison_id=2011";

            ClubPage page = new ClubPage(new HAPConnection(), logger);

            page.Parse(url);

            var domain = page.Domain;

            Assert.IsNotNull(domain, "The returned Domain is null.");

            TestingConfigs.DomainElementsCheck(domain);
            for (int i = 0; i < domain.Children.Count; i++)
            {
                TestingConfigs.DomainElementsCheck(domain.Children[i]);
            }
        }