public async Task GivenTheHealthCheckCache_WhenHealthCheckThrows_ThenTheResultIsWrittenCorrectly() { _healthCheck.When(x => x.CheckHealthAsync(Arg.Any <HealthCheckContext>())).Throw <Exception>(); var result = await _cahcedHealthCheck.CheckHealthAsync(_context, CancellationToken.None); Assert.Equal(HealthStatus.Unhealthy, result.Status); }