public DataManager(DataManagerConfig config) { Debug.WriteLine(config.ToString()); Config = config; ComputerManager.Initialize(config); if (config.MonitorCpu) { _cpuMonitor = new CpuMonitor(); } if (config.MonitorGpu) { _gpuMonitor = new GpuMonitor(); } if (config.MonitorMemory) { _memoryMonitor = new MemoryMonitor(); } if (config.MonitorDisks) { _diskMonitor = new DiskMonitor(); } if (Config.MonitorMotherboard) { _motherboardMonitor = new MotherboardMonitor(); } }
public async void MonitorShowsLoadMeansLoad() { var mockLogger = new Mock <ILogger <GpuMonitor> >(); var mockExecutor = new Mock <INvidiaSmiExecutor>(); var outputParser = new Mock <IGpuMonitorOutputParser>(); outputParser.Setup(x => x.IsGpuUnderLoad(It.IsAny <string>())).Returns(true); var objectUnderTest = new GpuMonitor(mockLogger.Object, new List <IGpuMonitorOutputParser>() { outputParser.Object }, mockExecutor.Object); var result = await objectUnderTest.IsGpuUnderLoadAsync(); result.Should().Be(true, "one parser is set to show load"); }