public async Task ReturnApiVersionAndOkDbStatusOnGet() { // arrange _fakeAdoHelper.Setup(o => o.ExecuteScalarAsync(_fakeDbCommand.Object)).ReturnsAsync(_fakeScalarResult); // act var result = await _target.Get(); // assert result.ApiVersion.Should().NotBeNullOrWhiteSpace(); result.DbStatus.Should().Be("OK"); _fakeAdoHelper.Verify(o => o.ExecuteScalarAsync(_fakeDbCommand.Object), Times.Once); LogAssert.AssertInfo(_fakeLogger, Times.AtLeastOnce); }
public async Task <IActionResult> Get() { _logger.LogInformation("Get: Begin"); var result = await _manager.Get(); _logger.LogInformation("Get: End"); return(Ok(result)); }