コード例 #1
0
        public void TestMethod9()
        {
            var baseUrl     = "http://www.demo.com/test/index.html";
            var relativeUrl = "/Next/default.html";

            var baseUri = baseUrl.ToUri();

            var url = RelativeHelper.RelativePathToUrl(baseUri, relativeUrl);

            Assert.IsTrue(url.IsEquals("http://www.demo.com/Next/default.html"));
        }
コード例 #2
0
        public void TestMethod3()
        {
            var baseUrl     = "http://www.demo.com/index.html";
            var relativeUrl = "Home/Index";

            var baseUri = baseUrl.ToUri();

            var url = RelativeHelper.RelativePathToUrl(baseUri, relativeUrl);

            Assert.IsTrue(url.IsEquals("http://www.demo.com/Home/Index"));
        }
コード例 #3
0
        public void TestMethod4()
        {
            var    baseUrl     = "http://www.demo.com/index.html";
            string relativeUrl = null;

            var baseUri = baseUrl.ToUri();

            var url = RelativeHelper.RelativePathToUrl(baseUri, relativeUrl);

            Assert.IsTrue(url.IsEquals("http://www.demo.com/index.html"));
        }
コード例 #4
0
        public void TestMethod18()
        {
            var baseUrl     = "http://www.demo.com/demo/test/index.html";
            var relativeUrl = "../../../td/rr/ww/def.html";

            var baseUri = baseUrl.ToUri();

            var url = RelativeHelper.RelativePathToUrl(baseUri, relativeUrl);

            Assert.IsTrue(url.IsEquals("http://www.demo.com/td/rr/ww/def.html"));
        }