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); }
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()); }
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()); }