예제 #1
0
파일: PathTest.cs 프로젝트: jdstroy/AlphaFS
        public void AlphaFS_Path_GetMappedConnectionName()
        {
            Console.WriteLine("Path.GetMappedConnectionName()");

            var cnt = 0;

            UnitTestConstants.StopWatcher(true);
            foreach (var drive in Directory.GetLogicalDrives().Where(drive => new DriveInfo(drive).IsUnc))
            {
                ++cnt;

                UnitTestConstants.StopWatcher(true);
                var gmCn = Path.GetMappedConnectionName(drive);
                var gmUn = Path.GetMappedUncName(drive);
                Console.WriteLine("\n\tMapped drive: [{0}]\tGetMappedConnectionName(): [{1}]", drive, gmCn);
                Console.WriteLine("\tMapped drive: [{0}]\tGetMappedUncName()       : [{1}]", drive, gmUn);

                Assert.IsTrue(!string.IsNullOrWhiteSpace(gmCn));
                Assert.IsTrue(!string.IsNullOrWhiteSpace(gmUn));
            }
            Console.WriteLine("\n{0}", UnitTestConstants.Reporter(true));

            if (cnt == 0)
            {
                Assert.Inconclusive("Nothing was enumerated because no mapped drives were found.");
            }
        }