public WinOSInfo GetWinInfo(bool format = false) { var winOSInfo = new WinOSInfo(); winOSInfo = WinOSInformation.GetInfoProcessor(winOSInfo); winOSInfo = WinOSInformation.GetInfoMemory(winOSInfo); winOSInfo = WinOSInformation.GetInfoDisk(winOSInfo); winOSInfo = WinOSInformation.GetInfoEthernet(winOSInfo); if (format) { var netFormat = winOSInfo.Networks .Select(x => { x.Speed = Formatter.FormatSpeedNet(x.Speed); return(x); }) .ToList(); winOSInfo.Networks = netFormat; } winOSInfo = WinOSInformation.GetInfoGPU(winOSInfo); winOSInfo = WinOSInformation.GetInfoOS(winOSInfo); winOSInfo = WinOSInformation.GetInfoProcesses(winOSInfo); winOSInfo = WinOSInformation.GetInfoServices(winOSInfo); return(winOSInfo); }
public void GetInfoMemory_ReturnDecimalLargerZero() { var winos = new WinOSInfo(); var result = WinOSInformation.GetInfoMemory(winos); Assert.True(result.MemorySize > 0); Assert.True(result.MemoryAvailable > 0); Assert.True(result.MemoryAvailableVertual > 0); Assert.True(result.MemoryVirtualSize > 0); }
public void GetInfoProcessor_ReturnsDataFormatString() { var winos = new WinOSInfo(); var result = WinOSInformation.GetInfoProcessor(winos); Assert.NotEmpty(result.ProcessorArchitecture); Assert.NotEmpty(result.ProcessorIden); Assert.NotEmpty(result.ProcessorLevel); Assert.NotEmpty(result.ProcessorNumber); }
public void GetInfoOS_ReturnDataCorrectGetInfoOS() { var winos = new WinOSInfo(); var result = WinOSInformation.GetInfoOS(winos); var first = result.OSInfos.FirstOrDefault(); Assert.NotNull(result.OSInfos); Assert.NotNull(first.OperationName); Assert.NotNull(first.OperationArchitecture); }
public void GetInfoProcesses_ReturnDataCorrectGetInfoProcesses() { var winos = new WinOSInfo(); var result = WinOSInformation.GetInfoProcesses(winos); Assert.NotNull(result.OSInfoProcesses); Assert.NotEmpty(result.OSInfoProcesses); foreach (var item in winos.OSInfoProcesses) { Assert.True(item.ProcessId > -1); Assert.NotNull(item.ProcessName); Assert.NotNull(item.Status); } }
public void GetInfoEthernet_ReturnDataCorrectInfoEthernet() { var winos = new WinOSInfo(); var result = WinOSInformation.GetInfoEthernet(winos); var first = result.Networks.FirstOrDefault(); Assert.True(result.ExistsConnection); Assert.NotNull(result.Networks); Assert.Equal(NetworkInterface.GetAllNetworkInterfaces().Count(), result.Networks.Count); Assert.NotNull(first.Name); Assert.NotNull(first.NetworkType); Assert.NotNull(first.Status); Assert.NotNull(first.Description); Assert.NotNull(first.Speed); }
public void GetInfoServices_ReturnDataCorrectGetInfoServices() { var winos = new WinOSInfo(); var result = WinOSInformation.GetInfoServices(winos); Assert.NotNull(result.OSInfoServices); foreach (var item in result.OSInfoServices) { Assert.NotNull(item.Name); Assert.NotNull(item.ServiceName); Assert.NotNull(item.ServicesType); Assert.NotNull(item.StartType); Assert.NotNull(item.Status); } }
public void GetInfoDisk_ReturnDataCorrectInfoDisks() { var winos = new WinOSInfo(); var result = WinOSInformation.GetInfoDisk(winos); var first = result.Disks.FirstOrDefault(); var di = DriveInfo.GetDrives().Where(x => x.IsReady).ToList(); Assert.NotNull(result.Disks); Assert.Equal(result.LogicalDisksCount, Directory.GetLogicalDrives().Length); Assert.Equal(di.Count, result.Disks.Count); Assert.NotNull(first.Name); Assert.True(first.TotalSize > 0); Assert.True(first.FreeSize > 0); Assert.NotNull(first.Format); Assert.NotNull(first.RootDirectory); }
public void GetInfoGPU_ReturnDataCorrectGetInfoGPU() { var winos = new WinOSInfo(); var result = WinOSInformation.GetInfoGPU(winos); var first = result.GPUs.FirstOrDefault(); Assert.NotNull(result.GPUs); Assert.NotNull(first.Name); Assert.NotNull(first.Status); Assert.NotNull(first.Caption); Assert.NotNull(first.DeviceID); Assert.True(first.AdapterRAM > 0); Assert.NotNull(first.AdapterDACType); Assert.NotNull(first.InstalledDisplayDrivers); Assert.NotNull(first.DriverVersion); Assert.NotNull(first.VideoProcessor); Assert.True(first.VideoArchitecture > 0); Assert.True(first.VideoMemoryType > 0); }