@Test public void shouldReturn1ForCpuFullyUsed() { CpuTimes cpuTimesPrev = new CpuTimes(100, 100, 0); CpuTimes cpuTimesNext = new CpuTimes(200, 200, 0); final float cpuUsage = cpuTimesNext.getCpuUsage(cpuTimesPrev); assertEqual(1f, cpuUsage); }
@Test public void shouldReturn0IfIdle() { CpuTimes cpuTimesPrev = new CpuTimes(100, 100, 0); CpuTimes cpuTimesNext = new CpuTimes(100, 100, 100); final float cpuUsage = cpuTimesNext.getCpuUsage(cpuTimesPrev); assertEqual(0f, cpuUsage); }