Exemple #1
0
        public void TestSetHost()
        {
            var baseUrl = new QUrl();

            baseUrl.Scheme = "ftp";
            baseUrl.SetAuthority("tray:[email protected]:2021");
            baseUrl.SetFragment("#question13");
            baseUrl.SetHost("ftp.example2.com");

            Assert.AreEqual("ftp.example2.com", baseUrl.Host());
        }
Exemple #2
0
        public void TestSetPath()
        {
            var baseUrl = new QUrl();

            baseUrl.Scheme = "ftp";
            baseUrl.SetAuthority("tray:[email protected]:2021");
            baseUrl.SetFragment("#question13");
            baseUrl.SetHost("ftp.example.com");
            baseUrl.SetPassword("5uQQo_f2");
            baseUrl.SetPath("/pub/something/");

            Assert.AreEqual("/pub/something/", baseUrl.Path());
        }
Exemple #3
0
        public void TestTopLevelDomain()
        {
            var baseUrl = new QUrl();

            baseUrl.Scheme = "ftp";
            baseUrl.SetAuthority("tray:[email protected]:2021");
            baseUrl.SetFragment("#question13");
            baseUrl.SetHost("ftp.example.com");
            baseUrl.SetUserName("tray2");
            baseUrl.SetPath("/pub/something/");
            baseUrl.SetPort(2022);
            baseUrl.SetUrl("");

            Assert.AreEqual(".com", baseUrl.TopLevelDomain());
        }
Exemple #4
0
        public void TestUrl()
        {
            var baseUrl = new QUrl();

            baseUrl.Scheme = "ftp";
            baseUrl.SetAuthority("tray:[email protected]:2021");
            baseUrl.SetFragment("#question13");
            baseUrl.SetHost("ftp.example.com");
            baseUrl.SetUserName("tray2");
            baseUrl.SetPath("/pub/something/");
            baseUrl.SetPort(2022);
            baseUrl.SetUrl("");

            throw new AssertionException("Url() not implemented!");
            //Assert.AreEqual(".com", baseUrl.Url());
        }
Exemple #5
0
        public void TestUrl()
        {
            var baseUrl = new QUrl();
            baseUrl.Scheme = "ftp";
            baseUrl.SetAuthority("tray:[email protected]:2021");
            baseUrl.SetFragment("#question13");
            baseUrl.SetHost("ftp.example.com");
            baseUrl.SetUserName("tray2");
            baseUrl.SetPath("/pub/something/");
            baseUrl.SetPort(2022);
            baseUrl.SetUrl("");

            throw new AssertionException("Url() not implemented!");
            //Assert.AreEqual(".com", baseUrl.Url());
        }
Exemple #6
0
        public void TestTopLevelDomain()
        {
            var baseUrl = new QUrl();
            baseUrl.Scheme = "ftp";
            baseUrl.SetAuthority("tray:[email protected]:2021");
            baseUrl.SetFragment("#question13");
            baseUrl.SetHost("ftp.example.com");
            baseUrl.SetUserName("tray2");
            baseUrl.SetPath("/pub/something/");
            baseUrl.SetPort(2022);
            baseUrl.SetUrl("");

            Assert.AreEqual(".com", baseUrl.TopLevelDomain());
        }
Exemple #7
0
        public void TestSetUserInfo()
        {
            var baseUrl = new QUrl();
            baseUrl.Scheme = "ftp";
            baseUrl.SetAuthority("tray:[email protected]:2021");
            baseUrl.SetFragment("#question13");
            baseUrl.SetHost("ftp.example.com");
            baseUrl.SetUserInfo("tray2:5uQQo_f2");
            baseUrl.SetPath("/pub/something/");
            baseUrl.SetPort(2022);
            baseUrl.SetUrl("");

            Assert.AreEqual("tray2", baseUrl.UserName());
            Assert.AreEqual("5uQQo_f2", baseUrl.Password());
            Assert.AreEqual("tray2:5uQQo_f2", baseUrl.UserInfo());
        }
Exemple #8
0
        public void TestSetQuery2()
        {
            var baseUrl = new QUrl();
            baseUrl.Scheme = "ftp";
            baseUrl.SetAuthority("tray:[email protected]:2021");
            baseUrl.SetFragment("#question13");
            baseUrl.SetHost("ftp.example.com");
            baseUrl.SetPassword("5uQQo_f2");
            baseUrl.SetPath("/pub/something/");
            baseUrl.SetPort(2022);
            baseUrl.SetQuery(new QUrlQuery("new"));

            Assert.AreEqual("new", baseUrl.Query());
        }
Exemple #9
0
        public void TestSetPassword()
        {
            var baseUrl = new QUrl();
            baseUrl.Scheme = "ftp";
            baseUrl.SetAuthority("tray:[email protected]:2021");
            baseUrl.SetFragment("#question13");
            baseUrl.SetHost("ftp.example.com");
            baseUrl.SetPassword("5uQQo_f2");

            Assert.AreEqual("5uQQo_f2", baseUrl.Password());
        }