public void TestMethod1() { var basePath = @"C:\Users\Administrator\source\repos\DwrUtility"; var fullPath = @"C:\Users\Administrator\source\repos"; var relativePath = RelativeHelper.FullPathToRelativePath(basePath, fullPath); Assert.IsTrue(relativePath.IsEquals("../repos")); }
public void TestMethod5() { string basePath = null; var fullPath = @"C:/Users/Administrator/source/repos"; var relativePath = RelativeHelper.FullPathToRelativePath(basePath, fullPath); Assert.IsTrue(relativePath.IsEquals(@"")); }
public void TestMethod6() { var basePath = @"C:/Users/Administrator"; string fullPath = null; var relativePath = RelativeHelper.FullPathToRelativePath(basePath, fullPath); Assert.IsTrue(relativePath.IsEquals(@"")); }
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")); }
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")); }
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")); }
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")); }
public void TestMethod22() { var baseUrl = "http://www.demo.com/demo/test/index.html"; var url = "http://www.demo.com/demo/rr//ww/def.html"; var baseUri = baseUrl.ToUri(); var uri = url.ToUri(); var toUrl = RelativeHelper.UriToRelativePath(baseUri, uri); Assert.IsTrue(toUrl.IsEquals("../rr//ww/def.html")); }