public void GetVolumeMountPoints()
 {
     foreach (string volumeName in VolumeMethods.GetVolumes())
     {
         var mountPoints = VolumeMethods.GetVolumeMountPoints(volumeName).ToArray();
     }
 }
 public void BasicGetDriveType()
 {
     foreach (string drive in VolumeMethods.GetLogicalDriveStrings())
     {
         var type = VolumeMethods.GetDriveType(drive);
     }
 }
        public void GetVolumeNames()
        {
            var volumeNames = VolumeMethods.GetVolumes().ToArray();

            volumeNames.Length.Should().BeGreaterThan(0);
            volumeNames[0].Should().StartWith(@"\\?\Volume{");
        }
        public void BasicLogicalDriveStrings()
        {
            var driveStrings = VolumeMethods.GetLogicalDriveStrings();

            driveStrings.Should().NotBeEmpty();
            driveStrings.Should().OnlyContain(t => t.Length == 3 && t[0] >= 'A' && t[0] <= 'Z' && t[1] == ':' && t[2] == '\\');
        }
        public void QueryDosDevice_C()
        {
            var names = VolumeMethods.QueryDosDevice("C:").ToArray();

            names.Length.Should().Be(1);
            names[0].Should().StartWith(@"\Device\HarddiskVolume");
        }
        public void QueryDosDevice_All()
        {
            var names = VolumeMethods.QueryDosDevice(null).ToArray();

            names.Should().Contain("Global");
            names.Should().Contain("C:");
            names[names.Length - 1].Should().NotBeNullOrEmpty("we split correctly");
        }
예제 #7
0
        public void InToCent()
        {
            var convert    = new VolumeMethods();
            var inch       = 12;
            var inchtocent = convert.ConvertCentimetersToInches(inch);

            Assert.AreEqual(30.48d, Math.Round((double)inchtocent));
        }
예제 #8
0
        public void CentToIn()
        {
            var convert  = new VolumeMethods();
            var cent     = 25;
            var centtoin = convert.ConvertCentimetersToInches(cent);

            Assert.AreEqual(9.84d, Math.Round((double)centtoin));
        }
 public void GetAllVolumeMountPoints()
 {
     foreach (string volumeName in VolumeMethods.GetVolumes())
     {
         foreach (string mountPoint in VolumeMethods.GetVolumePathNamesForVolumeName(volumeName))
         {
             mountPoint.Should().NotBeNullOrWhiteSpace();
         }
     }
 }
예제 #10
0
        public void Aggregate2Tier()
        {
            var aggregate        = new Aggregate();
            var volume           = new VolumeMethods();
            var firstVol         = volume.RoundPanVolume(10, 2);
            var secVol           = volume.SquarePanVolume(7, 2);
            var aggregateVolumes = aggregate.aggregate(firstVol, secVol);

            Assert.AreEqual(255, aggregateVolumes);
        }
예제 #11
0
 public void BasicGetVolumeInformation()
 {
     foreach (string drive in VolumeMethods.GetLogicalDriveStrings())
     {
         try
         {
             var info = VolumeMethods.GetVolumeInformation(drive);
             info.RootPathName.Should().Be(drive);
         }
         catch (DriveNotReadyException)
         {
         }
         catch (DriveLockedException)
         {
         }
     }
 }