protected override IEnumerable <ISystemChecker> CreateCheckers() { intrusiveSystemChecker = Substitute.For <ISystemChecker>(); intrusiveSystemChecker.CheckSystem().Returns(new SystemCheckResult()); intrusiveSystemChecker.IsIntrusive.Returns(true); yield return(intrusiveSystemChecker); }
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); } }
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)); } }