示例#1
0
 public void BasicGetDriveType()
 {
     foreach (string drive in VolumeDesktopMethods.GetLogicalDriveStrings())
     {
         var type = VolumeDesktopMethods.GetDriveType(drive);
     }
 }
示例#2
0
        public void BasicLogicalDriveStrings()
        {
            var driveStrings = VolumeDesktopMethods.GetLogicalDriveStrings();

            driveStrings.Should().NotBeEmpty();
            driveStrings.Should().OnlyContain(t => t.Length == 3 && t[0] >= 'A' && t[0] <= 'Z' && t[1] == ':' && t[2] == '\\');
        }
示例#3
0
 public void BasicGetVolumeInformation()
 {
     foreach (string drive in VolumeDesktopMethods.GetLogicalDriveStrings())
     {
         try
         {
             var info = VolumeDesktopMethods.GetVolumeInformation(drive);
             info.RootPathName.Should().Be(drive);
         }
         catch (DriveNotReadyException)
         {
         }
         catch (DriveLockedException)
         {
         }
     }
 }