public async Task ExecuteAsync_HappyPath_DataReturnGeneratedResponse() { var expectedResponse = new Fixture().Create <string>(); var dbCommand = CreateDbCommandForHappyPath(expectedResponse: expectedResponse); var command = new CommandSelectTables(); await command.ExecuteAsync(dbCommand); command.Data.Should().Be(expectedResponse); }
public async Task <ActionResult> Get() { var command = new CommandSelectTables(); await _dbCon.ExecuteAsync(command); if (command.IsSuccessful && command.Data.Length > 0) { Response.StatusCode = StatusCodes.Status200OK; return(Content(command.Data, "application/json")); } return(NoContent()); }