public void EnumerateDeviceFiles_HasSome() { var disks = new UDisks(); var deviceFiles = disks.Interface.EnumerateDeviceFiles(); Assert.Greater(deviceFiles.Count(), 0); }
public void EnumeratePorts_HasSome() { var disks = new UDisks(); var ports = disks.Interface.EnumeratePorts(); Assert.Greater(ports.Count(), 0); }
public void EnumerateExpanders_HasNone() { var disks = new UDisks(); var expanders = disks.Interface.EnumerateExpanders(); Assert.AreEqual(0, expanders.Count()); }
public void EnumerateAdapters_HasSome() { var disks = new UDisks(); var adapters = disks.Interface.EnumerateAdapters(); Assert.Greater(adapters.Count(), 0); }
public UDiskDevice GetUSBDevice() { // Just return the first USB device we find. Throw if there isn't one. var uDisks = new UDisks(); foreach (var device in uDisks.EnumerateDeviceOnInterface("usb")) { return(new UDiskDevice(device)); } throw new DriveNotFoundException("No USB drive available. Insert a USB drive for this test"); }
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) ); } }
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); } }