static void Main(string[] args) { List <Drive> listAll = DriveManager.GetAllDrives(); string path = "C:\\"; string pathRec = "C:\\"; var currentFolderItems = FolderManager.GetAllItemsForFolder(path); foreach (var item in listAll) { Console.WriteLine(item.Name); } Console.WriteLine("----------------------------------------------------------"); foreach (var item in currentFolderItems) { Console.WriteLine(item.Name); } Console.WriteLine("----------------------------------------------------------"); var items = GlobalFilesCalculation.GetFilesCount(pathRec); Console.WriteLine($"{items.FilesThatLessThan10Mb} -- " + $"{items.FilesBetween10ANd50Mb} --" + $"errors - {items.Errors} --" + $"{items.FilesMoreThan100Mb}"); Console.ReadKey(); }
public JsonResult Get() { var listAll = DriveManager.GetAllDrives(); Response.StatusCode = (int)HttpStatusCode.OK; return(Json(listAll)); }
public void GetCountOfDrivers() { List <Drive> drives = new List <Drive>(); int countDrive = 6; drives = DriveManager.GetAllDrives(); Assert.That(drives.Count, Is.EqualTo(countDrive)); }
public void GetCountForInanctiveDrives() { List <Drive> drives = new List <Drive>(); int inactiveDrives = 2; drives = DriveManager.GetAllDrives(); int inactDrives = drives.Where(c => c.IsReady == false).ToList().Count; Assert.That(inactiveDrives, Is.EqualTo(inactDrives)); }
public void GetSizeForC() { List <Drive> drives = new List <Drive>(); long diskCsize = 195; drives = DriveManager.GetAllDrives(); long diskC = drives.Where(c => c.Name == "C:\\").First().TotalSize; Assert.That(diskCsize, Is.EqualTo(diskC)); }
public void CheckSorting() { List <Drive> drives = new List <Drive>(); bool firstSizeMoreThanLast = true; drives = DriveManager.GetAllDrives(); var firstDrive = drives[0]; var lastDrive = drives[drives.Count - 1]; bool checkSize = firstDrive.TotalSize > lastDrive.TotalSize; Assert.That(firstSizeMoreThanLast, Is.EqualTo(checkSize)); }
public MainWindowViewModel() { Drives = new ObservableCollection <DriveInfo>(DriveManager.GetAllDrives()); }