예제 #1
0
파일: RootEntryTest.cs 프로젝트: CDEApp/CDE
        public void GetDriverLetterHint_SimplePath_ReturnsRootLetter()
        {
            var re = new RootEntryTestStub();

            var hint = re.GetDriverLetterHint(@"C:\MyFolder", @"C:\");

            Assert.That(hint, Is.EqualTo("C"));
        }
예제 #2
0
파일: RootEntryTest.cs 프로젝트: CDEApp/CDE
        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"));
        }
예제 #3
0
파일: RootEntryTest.cs 프로젝트: CDEApp/CDE
        public void GetDriverLetterHint_SimpleRootPathOddAsRootDifferent_ReturnsRootDriveLetter()
        {
            var re = new RootEntryTestStub();

            var hint = re.GetDriverLetterHint(@"C:\", @"D:\");

            Assert.That(hint, Is.EqualTo("D"));
        }
예제 #4
0
파일: RootEntryTest.cs 프로젝트: CDEApp/CDE
        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$\"));
        }
예제 #5
0
파일: RootEntryTest.cs 프로젝트: CDEApp/CDE
        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:\"));
        }
예제 #6
0
파일: RootEntryTest.cs 프로젝트: CDEApp/CDE
        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"));
        }
예제 #7
0
파일: RootEntryTest.cs 프로젝트: CDEApp/CDE
        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"));
        }
예제 #8
0
파일: RootEntryTest.cs 프로젝트: CDEApp/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"));
        }
예제 #9
0
파일: RootEntryTest.cs 프로젝트: CDEApp/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"));
        }
예제 #10
0
파일: RootEntryTest.cs 프로젝트: CDEApp/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"));
        }
예제 #11
0
파일: RootEntryTest.cs 프로젝트: CDEApp/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"));
        }