Exemple #1
0
        public void TestMixedCaseDomainSansSubDomains()
        {
            var url = new Url("http://WWW.EBAY.CO.UK/");

            Assert.AreEqual("ebay.co.uk", url.DomainSansSubDomain);
        }
Exemple #2
0
        public void TestFullPageWhenJustADomainWithATrailingSlash()
        {
            var url = new Url("http://www.watchdogapp.com/");

            Assert.AreEqual("Site Root", url.FullPage);
        }
Exemple #3
0
        public void TestLongDomainSansSubDomains()
        {
            var url = new Url("http://www.sales.stores.ebay.co.uk/");

            Assert.AreEqual("ebay.co.uk", url.DomainSansSubDomain);
        }
Exemple #4
0
        public void TestDomainWhenSubdomainIsSpecified()
        {
            var url = new Url("http://sub.watchdogapp.com/folder1/page1.html");

            Assert.AreEqual("sub.watchdogapp.com", url.Domain);
        }
Exemple #5
0
        public void TestDomainWithHttpsProtocolOnNonStandardPort()
        {
            var url = new Url("https://watchdogapp.com:666/folder1/page1.html");

            Assert.AreEqual("https://watchdogapp.com:666", url.DomainWithProtocol);
        }
Exemple #6
0
        public void TestGetTldWhenTldPartOfSubdomain()
        {
            var url = new Url("http://company.watchdogapp.org");

            Assert.AreEqual("org", url.Tld);
        }
Exemple #7
0
        public void TestDomain()
        {
            var url = new Url("http://watchdogapp.com/folder1/page1.html");

            Assert.AreEqual("watchdogapp.com", url.Domain);
        }
Exemple #8
0
        public void TestPathWithTwoFolderDeep()
        {
            var url = new Url("http://www.watchdogapp.com/folder/second/");

            Assert.AreEqual("/folder/second/", url.Path);
        }
Exemple #9
0
        public void TestPathWithFilenameDeep()
        {
            var url = new Url("http://www.watchdogapp.com/folder/second/page.html");

            Assert.AreEqual("/folder/second/", url.Path);
        }
Exemple #10
0
        public void TestFullPageWithQueryStringWhenNoQuery()
        {
            var url = new Url("http://www.watchdogapp.com/folder1/page1.html");

            Assert.AreEqual("/folder1/page1.html", url.FullPageWithQueryString);
        }
Exemple #11
0
        public void TestPathWithRootDomain()
        {
            var url = new Url("http://www.watchdogapp.com");

            Assert.AreEqual("/", url.Path);
        }
Exemple #12
0
        public void TestFullPageWithQueryString()
        {
            var url = new Url("http://www.watchdogapp.com/folder1/page1.html?parameter=first");

            Assert.AreEqual("/folder1/page1.html?parameter=first", url.FullPageWithQueryString);
        }
Exemple #13
0
        public void TestPageWhenJustADomain()
        {
            var url = new Url("http://www.watchdogapp.com");

            Assert.AreEqual("Site Root", url.Page);
        }
Exemple #14
0
        public void TestPage()
        {
            var url = new Url("http://www.watchdogapp.com/folder1/page1.html");

            Assert.AreEqual("page1.html", url.Page);
        }
Exemple #15
0
        public void TestNoDomainSansSubDomains()
        {
            var url = new Url("http:///search?id=50");

            Assert.AreEqual(string.Empty, url.DomainSansSubDomain);
        }
Exemple #16
0
        public void TestToStringWithQueryAndFragmentNoQueryNoFragment()
        {
            var url = new Url("http://www.google.com");

            Assert.AreEqual("http://www.google.com/", url.ToStringWithQueryAndFragment());
        }
Exemple #17
0
        public void TestDomainWithoutSubdomainWhenNoSubdomain()
        {
            var url = new Url("http://www.eed.eg/index.html");

            Assert.AreEqual("eed.eg", url.DomainSansSubDomain);
        }
Exemple #18
0
        public void TestToStringWithQueryAndFragmentHasQueryNoFragment()
        {
            var url = new Url("http://www.google.com").AddToQuery("page", 5);

            Assert.AreEqual("http://www.google.com/?page=5", url.ToStringWithQueryAndFragment());
        }
Exemple #19
0
        public void TestSubdomianWhenTldPartofSubdomain()
        {
            var url = new Url("http://company.watchdogapp.com");

            Assert.AreEqual("company", url.SubDomain);
        }
Exemple #20
0
        public void TestToStringWithQueryAndFragmentRemoveQuery()
        {
            var url = new Url("http://www.google.com/?page=5").RemoveFromQuery("page");

            Assert.AreEqual("http://www.google.com/", url.ToStringWithQueryAndFragment());
        }
Exemple #21
0
        public void TestDomainOnNonStandardPort()
        {
            var url = new Url("http://watchdogapp.com:8080/folder1/page1.html");

            Assert.AreEqual("watchdogapp.com:8080", url.Domain);
        }
Exemple #22
0
        public void TestDomainSansSubDomains()
        {
            var url = new Url("http://www.news.bbc.co.uk/");

            Assert.AreEqual("bbc.co.uk", url.DomainSansSubDomain);
        }
Exemple #23
0
        public void TestDomainWithHttpProtocol()
        {
            var url = new Url("http://watchdogapp.com/folder1/page1.html");

            Assert.AreEqual("http://watchdogapp.com", url.DomainWithProtocol);
        }
Exemple #24
0
        public void TestSingleDomainSansSubDomains()
        {
            var url = new Url("http://stackoverflow.com/");

            Assert.AreEqual("stackoverflow.com", url.DomainSansSubDomain);
        }
Exemple #25
0
        public void TestDomainWithoutWwwPrefix()
        {
            var url = new Url("http://www.watchdogapp.com/folder1/page1.html");

            Assert.AreEqual("watchdogapp.com", url.DomainSansWww);
        }
Exemple #26
0
        public void TestDomainWithoutWwwPrefixWhenSubdomainPresent()
        {
            var url = new Url("http://sub.watchdogapp.com/folder1/page1.html");

            Assert.AreEqual("sub.watchdogapp.com", url.DomainSansWww);
        }