예제 #1
0
        public void Add()
        {
            HTTPRequest requestBase = new HTTPRequest("http://www.somewhere.com/path/path/file.html");

            HTTPRequest request;

            request = requestBase.Add("../relpath/relfile.html");
            Assert.IsTrue("http://www.somewhere.com/path/relpath/relfile.html" == request.Url);

            request = requestBase.Add("/newpath/newfile.html");
            Assert.IsTrue("http://www.somewhere.com/newpath/newfile.html" == request.Url);

            request = requestBase.Add("http://www.somewhere_else.com/path/file.html");
            Assert.IsTrue("http://www.somewhere_else.com/path/file.html" == request.Url);

            requestBase = new HTTPRequest("http://spettacolo.alice.it/guidatv/cgi/index.cgi?tipo=3&channel=22");
            request     = requestBase.Add("?tipo=1&qs=8353441");
            Assert.IsTrue("http://spettacolo.alice.it/guidatv/cgi/index.cgi?tipo=1&qs=8353441" == request.Url);
        }