public void GetAverageRamTest_MoreThenStored() { var proc = Process.GetCurrentProcess(); ProcessStatistics stats = new ProcessStatistics(proc.Id, proc.ProcessName); stats.Stats.AddRange(Usage); var averageOf12 = stats.GetAverageRam(12); Assert.IsTrue(averageOf12 == (double)(1 + 2 + 3 + 4 + 5) / 5); }
public void GetAverageRamTest() { var proc = Process.GetCurrentProcess(); ProcessStatistics stats = new ProcessStatistics(proc.Id, proc.ProcessName); stats.Stats.AddRange(Usage); var averageOf3 = stats.GetAverageRam(3); Assert.IsTrue(averageOf3 == (double)(3 + 4 + 5) / 3); }