public void can_create_ignored()
        {
            var result = HealthCheckResult.Ignore();

            result.Message.Should().Be("ignored check");
            result.Status.Should().Be(HealthCheckStatus.Ignored);
        }
예제 #2
0
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            var source    = serializer.Deserialize <HealthStatusData>(reader);
            var healthy   = source.Healthy.Keys.Select(k => new HealthCheck.Result(k, HealthCheckResult.Healthy(source.Healthy[k])));
            var unhealthy = source.Unhealthy.Keys.Select(k => new HealthCheck.Result(k, HealthCheckResult.Unhealthy(source.Unhealthy[k])));
            var degraded  = source.Degraded.Keys.Select(k => new HealthCheck.Result(k, HealthCheckResult.Degraded(source.Degraded[k])));
            var ignored   = source.Ignored.Keys.Select(k => new HealthCheck.Result(k, HealthCheckResult.Ignore(source.Ignored[k])));
            var target    = new HealthStatus(healthy.Concat(unhealthy).Concat(degraded).Concat(ignored));

            return(target);
        }