private HardwareInformation GetCpuCoreCount() { var numOfCore = wmiHelper.GetWmiValue <uint>("Win32_Processor", "NumberOfCores"); var cpuCoreCount = new HardwareInformation() { MainValue = (double)numOfCore, ShortName = "CPU", UnitSymbol = (numOfCore > 1) ? "Cores" : "Core", }; return(cpuCoreCount); }
public void GivenValidWmiPathAndKey_WhenRequestingData_ThenItReturnsProper() { double loadPercentage = wmiHelperSubject.GetWmiValue <double>("Win32_Processor", "LoadPercentage"); Assert.True(loadPercentage > 0); }