public void IsValidURL() { var url = new MyUrlParse("https://www.youtube.com/watch?v=YR12Z8f1Dh8&feature=relmfu"); Assert.IsTrue(true == url.valid); }
public void PathTest() { var url = new MyUrlParse("foo://*****:*****@example.com:8042/over/there?name=ferret#nose"); Assert.IsTrue("/over/there" == url.path); }
public void HostTest() { var url = new MyUrlParse("foo://example.com:8042/over/there?name=ferret#nose"); Assert.IsTrue("example.com" == url.host); }
public void PortTestUserInfo() { var url = new MyUrlParse("foo://*****:*****@example.com:8042/over/there?name=ferret#nose"); Assert.IsTrue("8042" == url.port); }
public void UserTest() { var url = new MyUrlParse("http://*****:*****@example.com/"); Assert.IsTrue("username" == url.user); }
public void PasswordTest() { var url = new MyUrlParse("http://*****:*****@example.com/"); Assert.IsTrue("password" == url.password); }
public void IsInvalidURL() { var url = new MyUrlParse("123"); Assert.IsTrue(false == url.valid); }
public void SchemeTest() { var url = new MyUrlParse("https://www.youtube.com/watch?v=YR12Z8f1Dh8&feature=relmfu"); Assert.IsTrue("https" == url.scheme); }
public void IsValidNullUrl() { var url = new MyUrlParse(null); Assert.IsTrue(false == url.valid); }
public void IsValidEmptyUrl() { var url = new MyUrlParse(""); Assert.IsTrue(false == url.valid); }
public void FragmentTestWithoutQuery() { var url = new MyUrlParse("foo://*****:*****@example.com:8042/over/there#nose"); Assert.IsTrue("#nose" == url.fragment); }
public void FragmentTest() { var url = new MyUrlParse("foo://*****:*****@example.com:8042/over/there?name=ferret#nose"); Assert.IsTrue("#nose" == url.fragment); }
public void QueryEmptyTest() { var url = new MyUrlParse("foo://*****:*****@example.com:8042/over/there#nose"); Assert.IsTrue("" == url.query); }