示例#1
0
        public void IsValidURL()
        {
            var url = new MyUrlParse("https://www.youtube.com/watch?v=YR12Z8f1Dh8&feature=relmfu");

            Assert.IsTrue(true == url.valid);
        }
示例#2
0
        public void PathTest()
        {
            var url = new MyUrlParse("foo://*****:*****@example.com:8042/over/there?name=ferret#nose");

            Assert.IsTrue("/over/there" == url.path);
        }
示例#3
0
        public void HostTest()
        {
            var url = new MyUrlParse("foo://example.com:8042/over/there?name=ferret#nose");

            Assert.IsTrue("example.com" == url.host);
        }
示例#4
0
        public void PortTestUserInfo()
        {
            var url = new MyUrlParse("foo://*****:*****@example.com:8042/over/there?name=ferret#nose");

            Assert.IsTrue("8042" == url.port);
        }
示例#5
0
        public void UserTest()
        {
            var url = new MyUrlParse("http://*****:*****@example.com/");

            Assert.IsTrue("username" == url.user);
        }
示例#6
0
        public void PasswordTest()
        {
            var url = new MyUrlParse("http://*****:*****@example.com/");

            Assert.IsTrue("password" == url.password);
        }
示例#7
0
        public void IsInvalidURL()
        {
            var url = new MyUrlParse("123");

            Assert.IsTrue(false == url.valid);
        }
示例#8
0
        public void SchemeTest()
        {
            var url = new MyUrlParse("https://www.youtube.com/watch?v=YR12Z8f1Dh8&feature=relmfu");

            Assert.IsTrue("https" == url.scheme);
        }
示例#9
0
        public void IsValidNullUrl()
        {
            var url = new MyUrlParse(null);

            Assert.IsTrue(false == url.valid);
        }
示例#10
0
        public void IsValidEmptyUrl()
        {
            var url = new MyUrlParse("");

            Assert.IsTrue(false == url.valid);
        }
示例#11
0
        public void FragmentTestWithoutQuery()
        {
            var url = new MyUrlParse("foo://*****:*****@example.com:8042/over/there#nose");

            Assert.IsTrue("#nose" == url.fragment);
        }
示例#12
0
        public void FragmentTest()
        {
            var url = new MyUrlParse("foo://*****:*****@example.com:8042/over/there?name=ferret#nose");

            Assert.IsTrue("#nose" == url.fragment);
        }
示例#13
0
        public void QueryEmptyTest()
        {
            var url = new MyUrlParse("foo://*****:*****@example.com:8042/over/there#nose");

            Assert.IsTrue("" == url.query);
        }