public void TestOneHourAvg() { GpuState state = CreateGpuState(); state.UpdateAverages(); Assert.AreEqual(1250.0, state.OneHourHashAvg); }
public void TestFiveMinAvg() { GpuState state = CreateGpuState(); state.UpdateAverages(); Assert.AreEqual(2000.0, state.FiveMinHashAvg); }
private GpuState CreateGpuState() { GpuState state = new GpuState(); state.AddSample(new GpuSample(DateTime.Now - TimeSpan.FromMinutes(65), 1000, 3000, 50)); state.AddSample(new GpuSample(DateTime.Now - TimeSpan.FromMinutes(60), 1000, 3000, 50)); state.AddSample(new GpuSample(DateTime.Now - TimeSpan.FromMinutes(59), 1000, 3000, 50)); state.AddSample(new GpuSample(DateTime.Now - TimeSpan.FromMinutes(31), 1000, 3000, 50)); state.AddSample(new GpuSample(DateTime.Now - TimeSpan.FromMinutes(30), 1000, 3000, 50)); state.AddSample(new GpuSample(DateTime.Now - TimeSpan.FromMinutes(29), 1000, 3000, 50)); state.AddSample(new GpuSample(DateTime.Now - TimeSpan.FromMinutes(6), 1000, 3000, 50)); state.AddSample(new GpuSample(DateTime.Now - TimeSpan.FromMinutes(5), 1000, 3000, 50)); state.AddSample(new GpuSample(DateTime.Now - TimeSpan.FromMinutes(1), 2000, 3000, 50)); state.AddSample(new GpuSample(DateTime.Now - TimeSpan.FromMinutes(0), 2000, 3000, 50)); state.UpdateAverages(); return(state); }