コード例 #1
0
        public void CreateHealthCheckResult_GivenNullHealthCheck_Throws()
        {
            IHealthCheck healthCheck = null;

            Action act = () => healthCheck.CreateHealthCheckResult();

            act.Should().ThrowExactly <ArgumentNullException>().WithMessage("*healthCheck*");
        }
コード例 #2
0
        private HealthCheckResult[] GetExceptionHealthCheckResult(IHealthCheck healthCheck, Exception ex)
        {
            var result = healthCheck.CreateHealthCheckResult();

            result.Output = $"Exception in health check of type {healthCheck.GetType()}:\r\n{ex}";

            if (UncaughtExceptionStatus != null)
            {
                result.Status = UncaughtExceptionStatus;
            }

            return(new[] { result });
        }