Example #1
0
        public void UpdateShouldNotUpdateWhenCompleteAdding()
        {
            var timeRecord = new ConcereteTimeRecord(1, 1, 1);

            timeRecord.CompleteAdding();
            Assert.That(timeRecord.GetCpuLoad(), Is.EqualTo(0));

            timeRecord.Update(new IncomingRecordData()
            {
                CpuLoad = 100
            });
            Assert.That(timeRecord.GetCpuLoad(), Is.EqualTo(0));
        }
Example #2
0
        public void UpdateEmptyShouldAffectAverage()
        {
            var timeRecord = new ConcereteTimeRecord(1, 1, 1);

            timeRecord.Update(new IncomingRecordData()
            {
                CpuLoad = 100
            });
            timeRecord.UpdateEmpty();
            Assert.That(timeRecord.GetCpuLoad(), Is.EqualTo(50));
        }
Example #3
0
        public void GetCpuLoadShouldRoundToTwo()
        {
            var timeRecord = new ConcereteTimeRecord(1, 1, 1);

            timeRecord.Update(new IncomingRecordData()
            {
                CpuLoad = 100
            });
            timeRecord.UpdateEmpty();
            timeRecord.UpdateEmpty();
            Assert.That(timeRecord.GetCpuLoad(), Is.EqualTo(33.33));
        }