Esempio n. 1
0
        protected override IEnumerable <ISystemChecker> CreateCheckers()
        {
            intrusiveSystemChecker = Substitute.For <ISystemChecker>();
            intrusiveSystemChecker.CheckSystem().Returns(new SystemCheckResult());
            intrusiveSystemChecker.IsIntrusive.Returns(true);

            yield return(intrusiveSystemChecker);
        }
Esempio n. 2
0
 private static SystemCheckResult GetSystemCheckResult(bool performeIntrusive, ISystemChecker systemChecker)
 {
     if (!performeIntrusive && systemChecker.IsIntrusive)
     {
         return systemChecker.CreateSkippedResult();
     }
     try
     {
         return systemChecker.CheckSystem() ?? systemChecker.CreateResult(HealthState.Undetermined, "Null result returned");
     }
     catch (Exception ex)
     {
         return systemChecker.CreateCriticalResult(ex.Message);
     }
 }
Esempio n. 3
0
 private static SystemCheckResult GetSystemCheckResult(bool performeIntrusive, ISystemChecker systemChecker)
 {
     if (!performeIntrusive && systemChecker.IsIntrusive)
     {
         return(systemChecker.CreateSkippedResult());
     }
     try
     {
         return(systemChecker.CheckSystem() ?? systemChecker.CreateResult(HealthState.Undetermined, "Null result returned"));
     }
     catch (Exception ex)
     {
         return(systemChecker.CreateCriticalResult(ex.Message));
     }
 }