Пример #1
0
        public void GetRelativePathTo_works_with_http_and_https()
        {
            var baseUri = new XUri("http://foo/a");
            var uri     = new XUri("https://foo/a/b/c");
            var result  = uri.GetRelativePathTo(baseUri);

            Assert.AreEqual("b/c", result);
        }
Пример #2
0
        public void Can_roundtrip_GetRelativePathTo_via_AtPath_with_trailing_slash_on_base()
        {
            var uri       = new XUri("http://foo/a/b/c");
            var baseUri   = new XUri("http://foo/a/");
            var relative  = uri.GetRelativePathTo(baseUri);
            var roundtrip = baseUri.AtPath(relative);

            Assert.AreEqual(uri.ToString(), roundtrip.ToString());
        }
Пример #3
0
 public void GetRelativePathTo_works_with_http_and_https()
 {
     var baseUri = new XUri("http://foo/a");
     var uri = new XUri("https://foo/a/b/c");
     var result = uri.GetRelativePathTo(baseUri);
     Assert.AreEqual("b/c", result);
 }
Пример #4
0
 public void Can_roundtrip_GetRelativePathTo_via_AtPath_with_trailing_slash_on_uri()
 {
     var uri = new XUri("http://foo/a/b/c/");
     var baseUri = new XUri("http://foo/a");
     var relative = uri.GetRelativePathTo(baseUri);
     var roundtrip = baseUri.AtPath(relative);
     Assert.AreEqual(uri.ToString(), roundtrip.ToString());
 }