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

            yield return(intrusiveSystemChecker);
        }
示例#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);
     }
 }
示例#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));
     }
 }