public void HandleFailingDrivesProperly() { List <string> failing_drive_letters = new List <string>(); SmartStatus smart_status = new SmartStatus(); EStatusType status = smart_status.GetStatus(failing_drive_letters); Assert.Equal(EStatusType.DiskFailureNotPredicted, status); failing_drive_letters.Add("C:"); status = smart_status.GetStatus(failing_drive_letters); Assert.Equal(EStatusType.DiskFailurePredicted, status); }
public void Interpret(Data data, SQLiteConnection conn) { if (data.Type == ECollectorType.SMART) { ListData <HardDisk> disks = data as ListData <HardDisk>; if (disks == null) { return; } long device_id = GetDeviceID(data, conn); if (device_id >= 0) { List <string> drive_letter_list = HardDisk.FailingDrives(disks.Data); SmartStatus smart_status = new SmartStatus(); EStatusType status = smart_status.GetStatus(drive_letter_list); SetDeviceStatus(device_id, status, SmartStatus.Types, drive_letter_list.JoinStrings(", "), conn); } } }