Exemplo n.º 1
0
        public void TestCompetitionParsing()
        {
            string url = "https://www.transfermarkt.pt/serie-a/startseite/wettbewerb/IT1";

            url = "https://www.transfermarkt.pt/liga-nos/startseite/wettbewerb/PO1/plus/?saison_id=2019";
            CompetitionPage page = new CompetitionPage(new HAPConnection(), logger);

            page.Parse(url);

            var domain = page.Domain;

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

            TestingConfigs.DomainElementsCheck(domain);

            // Clubs
            for (int i = 0; i < domain.Children.Count; i++)
            {
                var clubChild = domain.Children[i];
                TestingConfigs.DomainElementsCheck(clubChild);

                for (int j = 0; j < clubChild.Children.Count; j++)
                {
                    var playerChild = clubChild.Children[j];
                    TestingConfigs.DomainElementsCheck(playerChild);
                }
            }
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
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]);
            }
        }