Esempio n. 1
0
        public void CompareWebSites()
        {
            var url1 = @"http://en.wikipedia.org/wiki/Sweden";
            var url2 = @"http://en.wikipedia.org/wiki/Finland";

            var selector = "*";

            var siteCompare = new SiteCompare(url1, url2, selector);

            Assert.IsNotNull(siteCompare);

        }
Esempio n. 2
0
        public void CompareWebSitesMultipleUrls()
        {
            var url1 = @"http://en.wikipedia.org/wiki/";
            var url2 = @"http://en.wikipedia.org/wiki/";

            var urlList = new[] { "Sweden", "Finland" };

            var selector = "*";

            var siteCompare = new SiteCompare(url1, url2, urlList, selector);

            Assert.IsNotNull(siteCompare);

        }
Esempio n. 3
0
        public void CompareSnapshots()
        {

            var comparePath1 = @"c:\data\filedump\wikipedia\1\";
            var comparePath2 = @"c:\data\filedump\wikipedia\2\";
            var urlList = new[] { "Sweden.html", "Norway.html", "Finland.html" };

            var selector = "*";

            var siteDiff = new SiteCompare(comparePath1, comparePath2, urlList, selector);

            Assert.IsNotNull(siteDiff);

            var report = siteDiff.TextReport;

            Assert.IsNotNull(report);


            // sample result:

            //=======================
            //Compare result
            //=======================
            //Path 1: c:\data\filedump\wikipedia\1\Sweden.html
            //Path 2: c:\data\filedump\wikipedia\2\Sweden.html
            //Equals
            //=======================
            //Path 1: c:\data\filedump\wikipedia\1\Norway.html
            //Path 2: c:\data\filedump\wikipedia\2\Norway.html
            //Equals
            //=======================
            //Path 1: c:\data\filedump\wikipedia\1\Finland.html
            //Path 2: c:\data\filedump\wikipedia\2\Finland.html
            //Number of diffs: 2
            //----------------------
            //Selector: html.client-nojs > head > title
            //Html 1: Finland - Wikip...
            //Html 2: Funland - Wikip...
            //----------------------
            //Selector: H1#firstHeading span
            //Html 1: Finland
            //Html 2: Funland
            //=======================
            //Total number of diffs: 2
            //=======================


        }