public void ChildState_TurnToGood_IsHealthy(ReportingStrategy reportingStrategy) { _healthStatus = new PassiveAggregatingHealthCheck(_dateTimeFake, COMPONENT_NAME, healthMonitor, reportingStrategy); _healthStatus.SetBad("", TimeSpan.FromSeconds(1), "child"); _getHealthResult().IsHealthy.ShouldBe(false); _healthStatus.SetGood("", TimeSpan.FromSeconds(1), "child"); _getHealthResult().IsHealthy.ShouldBe(true); }
public void UnhealthyOnAtLeastOneChild_UnsetBadChild_IsHealthy(ReportingStrategy reportingStrategy) { _healthStatus = new PassiveAggregatingHealthCheck(_dateTimeFake, COMPONENT_NAME, healthMonitor, reportingStrategy); _healthStatus.SetBad("", TimeSpan.FromSeconds(1), "parent", "child"); _getHealthResult().IsHealthy.ShouldBe(false); _healthStatus.Unset("parent", "child"); _getHealthResult().IsHealthy.ShouldBe(true); }
public void BadState_Expires(ReportingStrategy reportingStrategy) { _healthStatus = new PassiveAggregatingHealthCheck(_dateTimeFake, COMPONENT_NAME, healthMonitor, reportingStrategy); _healthStatus.SetBad("", TimeSpan.FromSeconds(1), "level1"); var result = _getHealthResult(); result.IsHealthy.ShouldBe(false); _dateTimeFake.UtcNow += TimeSpan.FromSeconds(1); result = _getHealthResult(); result.IsHealthy.ShouldBe(true); }