public void CanonicalPath_UNCTrailingSlash2_OK() { var re = new RootEntryTestStub(isUnc: true, root: @"\\Friday\d$", fullPath: @"\\Friday\d$"); const string testPath = @"\\Friday\d$"; var result = re.CanonicalPath(testPath); Assert.That(result, Is.EqualTo(@"\\Friday\d$\")); }
public void CanonicalPath_DeviceRelativePath_OK() { var re = new RootEntryTestStub(isUnc: false, root: @"g:\", fullPath: @"g:\"); const string testPath = @"g:"; var result = re.CanonicalPath(testPath); Assert.That(result, Is.EqualTo(@"G:\")); }
public void CanonicalPath_TrailingSlash_OK() { var re = new RootEntryTestStub(isUnc: false, root: @"c:\", fullPath: @"c:\Windows"); const string testPath = @"c:\Windows\"; var result = re.CanonicalPath(testPath); Assert.That(result, Is.EqualTo(@"C:\Windows")); }
public void GetDefaultFileName_RootedPathByLeadingSlash_UsingFullPath() { var re = new RootEntryTestStub(fullPath: @"C:\MyTestFolder\Mine"); string hint, volRoot, volName; var canonicalName = re.CanonicalPath(@"\MyTestFolder\Mine"); var fileName = re.GetDefaultFileName(canonicalName, out hint, out volRoot, out volName); Assert.That(hint, Is.EqualTo(@"C")); Assert.That(volRoot, Is.EqualTo(@"C:\")); Assert.That(volName, Is.EqualTo(@"VolName")); Assert.That(fileName, Is.EqualTo(@"C-VolName-C__MyTestFolder_Mine.cde")); }