Example #1
0
        protected override bool?RunTest(ref string message)
        {
            var entries = _healthCounterRepository.ProbeAndPrune().ToList();

            if (entries.Any())
            {
                message = $"The following pulse functions recently ({_healthCounterRepository.MaxAge}) encounter errors:";
                foreach (var healthCounter in entries)
                {
                    message +=
                        $"\n\"{healthCounter.Id}\" count : {healthCounter.Count} last timestamp : {healthCounter.TimeStamp.ToLocalTime()} last message : {healthCounter.Message}";
                }
                return(false);
            }
            message = $"No pulse function have failed recently ({_healthCounterRepository.MaxAge}).";
            return(true);
        }
Example #2
0
 public void InitTest()
 {
     Assert.That(HealthCounterRepository.MaxAge, Is.EqualTo(MaxAge));
     Assert.That(HealthCounterRepository.ProbeAndPrune(), Is.Empty);
 }