public void TestIsCookieForUrlWithPathCookieCorrectSubdirUrl()
        {
            Cookie cookie = new Cookie("subdir", "1", "/b", "a.com")
            {
                Secure = false
            };

            Assert.IsTrue(ResourceFetcher.IsCookieForUrl_(cookie, new Uri("http://a.com/b/c")));
        }
        public void TestIsCookieForUrlWithSecureCookieSecureUrl()
        {
            Cookie cookie = new Cookie("subdir", "1", "/", "a.com")
            {
                Secure = true
            };

            Assert.IsTrue(ResourceFetcher.IsCookieForUrl_(cookie, new Uri("https://a.com/subdir")));
        }
        public void TestIsCookieForUrlWithDottedIncorrectSuffixedDomain()
        {
            Cookie cookie = new Cookie("subdir", "1", "/", ".a.com")
            {
                Secure = false
            };

            Assert.IsFalse(ResourceFetcher.IsCookieForUrl_(cookie, new Uri("http://ba.com/")));
        }
        public void TestNotIsCookieForUrlWithNotDottedCorrectSubdomain()
        {
            Cookie cookie = new Cookie("subdir", "1", "/", "a.com")
            {
                Secure = false
            };

            Assert.IsFalse(ResourceFetcher.IsCookieForUrl_(cookie, new Uri("http://b.a.com/")));
        }
        public void TestIsCookieForUrlWithDottedCorrectDomainIgnorePort()
        {
            Cookie cookie = new Cookie("subdir", "1", "/", ".a.com")
            {
                Secure = false
            };

            Assert.IsTrue(ResourceFetcher.IsCookieForUrl_(cookie, new Uri("http://a.com:8080/")));
        }
        public void TestNotIsCookieForUrlExpiredWithDottedCorrectDomain()
        {
            Cookie cookie = new Cookie("subdir", "1", "/", ".a.com")
            {
                Expiry = new DateTime(1),
                Secure = false
            };

            Assert.IsFalse(ResourceFetcher.IsCookieForUrl_(cookie, new Uri("http://a.com/")));
        }