Beispiel #1
0
        public void EnumerateUSB_HasOnlyPartitions()
        {
            var disks   = new UDisks();
            var devices = disks.EnumerateDeviceOnInterface("usb");

            Assert.Greater(devices.Count(), 0);
            foreach (var device in devices)
            {
                var uDiskDevice = new UDiskDevice(device);
                Assert.AreEqual("True", uDiskDevice.GetProperty("DeviceIsPartition"),
                                String.Format("Device {0} does not have a partition", device)
                                );
            }
        }
Beispiel #2
0
        public void EnumerateUSB_HasOnlyUSBDevices()
        {
            var disks   = new UDisks();
            var devices = disks.EnumerateDeviceOnInterface("usb");

            Assert.Greater(devices.Count(), 0);
            // Check that the devices don't exist on any interface other than usb
            foreach (var device in devices)
            {
                var    uDiskDevice = new UDiskDevice(device);
                string iface       = uDiskDevice.GetProperty("DriveConnectionInterface");
                Assert.AreEqual("usb", iface);
            }
        }