Example #1
0
 public HealthIndicator Get()
 {
     _logger.Information("Health endpoint called.");
     return(new HealthIndicator(_applicationHealthService.IsApplicationHealthy(),
                                _serverHealthService.IsServerHealthy(),
                                _databaseHealthService.IsDatabaseHealthy(),
                                _serverHealthService.Hostname,
                                _dateTimeService.Now()));
 }
        public void PassedDatabaseHealthShouldBeReturnedByGet(bool value)
        {
            // arrange
            _databaseHealthService.IsDatabaseHealthy().Returns(value);

            // act
            var result = _subject.Get();

            // assert
            result.DatabaseHealthy.Should().Be(value);
        }