public void GetDriverLetterHint_SimplePath_ReturnsRootLetter() { var re = new RootEntryTestStub(); var hint = re.GetDriverLetterHint(@"C:\MyFolder", @"C:\"); Assert.That(hint, Is.EqualTo("C")); }
public void GetDriverLetterHint_UncPath_ReturnsUNC() { var re = new RootEntryTestStub(isUnc: true); var hint = re.GetDriverLetterHint(@"\\server\basepath\path", @"doest matter"); Assert.That(hint, Is.EqualTo("UNC")); }
public void GetDriverLetterHint_SimpleRootPathOddAsRootDifferent_ReturnsRootDriveLetter() { var re = new RootEntryTestStub(); var hint = re.GetDriverLetterHint(@"C:\", @"D:\"); Assert.That(hint, Is.EqualTo("D")); }
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_UNCPath2_UsesFullPath() { var re = new RootEntryTestStub(isUnc: true, fullPath: @"\\myserver\myshare\stuff"); string hint, volRoot, volName; var fileName = re.GetDefaultFileName(@"\\myserver\myshare\stuff", out hint, out volRoot, out volName); Assert.That(hint, Is.EqualTo(@"UNC")); Assert.That(volRoot, Is.EqualTo(@"C:\")); Assert.That(volName, Is.EqualTo(@"VolName")); Assert.That(fileName, Is.EqualTo(@"UNC-myserver_myshare_stuff.cde")); }
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")); }
public void GetDefaultFileName_SimplePath2_ReturnsExpectedStuff() { var re = new RootEntryTestStub(fullPath: @"C:\MyTestFolder\Mine"); string hint, volRoot, volName; var fileName = re.GetDefaultFileName(@"C:\MyTestFolder\Mine", 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")); }
public void GetDefaultFileName_SimpleRootPath_ReturnsExpectedStuff() { var re = new RootEntryTestStub(); string hint, volRoot, volName; var fileName = re.GetDefaultFileName(@"C:\", 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.cde")); }
public void GetDefaultFileName_SimpleRootPath2_ReturnsExpectedStuff() { // ReSharper disable RedundantArgumentName var re = new RootEntryTestStub(root: @"D:\", volName: "OtherValue", fullPath: @"D:\"); // ReSharper restore RedundantArgumentName string hint, volRoot, volName; var fileName = re.GetDefaultFileName(@"D:\", out hint, out volRoot, out volName); Assert.That(hint, Is.EqualTo(@"D")); Assert.That(volRoot, Is.EqualTo(@"D:\")); Assert.That(volName, Is.EqualTo(@"OtherValue")); Assert.That(fileName, Is.EqualTo(@"D-OtherValue.cde")); }