Exemplo n.º 1
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));
        }
Exemplo n.º 2
0
        public void GetRamLoadShouldRoundToTwo()
        {
            var timeRecord = new ConcereteTimeRecord(1, 1, 1);

            timeRecord.Update(new IncomingRecordData()
            {
                RamLoad = 100
            });
            timeRecord.UpdateEmpty();
            timeRecord.UpdateEmpty();
            Assert.That(timeRecord.GetRamLoad(), Is.EqualTo(33.33));
        }
Exemplo n.º 3
0
        public void UpdateEmptyShouldNotUpdateWhenCompleteAdding()
        {
            var timeRecord = new ConcereteTimeRecord(1, 1, 1);

            timeRecord.Update(new IncomingRecordData()
            {
                CpuLoad = 100
            });
            timeRecord.CompleteAdding();
            timeRecord.UpdateEmpty();
            Assert.That(timeRecord.GetCpuLoad(), Is.EqualTo(100));
        }
Exemplo n.º 4
0
        public void CompleteAddingShouldStopUpdates()
        {
            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));
        }