public void ConvertToLocalPath_01() { const string localBasePath = @"c:\temp"; const string repoBasePath = @"/Root/ParentFolder"; Assert.AreEqual(@"c:\temp\abc", RepositoryPath.ConvertToLocalPath(@"/Root/ParentFolder/abc", localBasePath, repoBasePath), "Generic test 1"); Assert.AreEqual(@"c:\temp\abc\def\ghi", RepositoryPath.ConvertToLocalPath(@"/Root/ParentFolder/abc/def/ghi", localBasePath, repoBasePath), "Generic test 2"); Assert.AreEqual(@"c:\temp\abc\def\ghi.txt", RepositoryPath.ConvertToLocalPath(@"/Root/ParentFolder/abc/def/ghi.txt", localBasePath, repoBasePath), "Generic test 3"); Assert.AreEqual(@"c:\temp\ABC", RepositoryPath.ConvertToLocalPath(@"/Root/PARENTFolder/ABC", localBasePath, repoBasePath), "Case insensitivity test"); Assert.AreEqual(@"c:\temp\abc", RepositoryPath.ConvertToLocalPath(@"/Root/ParentFolder/abc/", localBasePath + "\\", repoBasePath), "Trim test 1"); Assert.AreEqual(@"c:\temp\abc", RepositoryPath.ConvertToLocalPath(@"/Root/ParentFolder/abc", localBasePath + "\\", repoBasePath + "/"), "Trim test 2"); Assert.AreEqual(@"c:\temp\abc", RepositoryPath.ConvertToLocalPath(@"/Root/ParentFolder/abc/", localBasePath, repoBasePath + "/"), "Trim test 3"); Assert.AreEqual(@"c:\temp\abc", RepositoryPath.ConvertToLocalPath(@"/Root/ParentFolder/abc/", localBasePath, repoBasePath), "Trim test 4"); }
public void ConvertToLocalPath_04() { RepositoryPath.ConvertToLocalPath("/Root/abc", @"c:\temp", "/Root/x/y"); }
public void ConvertToLocalPath_02() { RepositoryPath.ConvertToLocalPath("x", @"c:\temp", "/Root"); }