示例#1
0
        public void Adding_check_makes_it_available()
        {
            const string name = "test";

            HealthChecks.Add(name, () => false);

            var exists = HealthChecks.Exists(name);

            exists.Should().BeTrue();
        }
示例#2
0
        public Settings AddHealthCheckEndpoint(string name, string uri)
        {
            HealthChecks.Add(new HealthCheckSetting
            {
                Name = name,
                Uri  = uri
            });

            return(this);
        }
示例#3
0
        public void When_check_succeeds_a_success_is_returned()
        {
            const string name           = "test";
            const bool   expectedResult = true;

            HealthChecks.Add(name, () => expectedResult);

            var results = HealthChecks.RunAll();

            results.Should().Contain(name, expectedResult);
        }
示例#4
0
 public void RegisterHealthCheck(string name, HealthCheck healthCheck)
 {
     HealthChecks.Add(name, healthCheck);
 }
示例#5
0
        public HealthChecksBuilder AddCheck(string name, Func <HealthCheckResult> check)
        {
            HealthChecks.Add(name, new Registration(new LambdaHealthCheck(check)));

            return(this);
        }
示例#6
0
        public HealthChecksBuilder AddCheck <T>(string name) where T : IHealthCheck
        {
            HealthChecks.Add(name, new Registration(typeof(T)));

            return(this);
        }
示例#7
0
        public HealthChecksBuilder AddCheck(string name, IHealthCheck healthCheck)
        {
            HealthChecks.Add(name, new Registration(healthCheck));

            return(this);
        }