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