How can I use IConfiguration from my integration tests?
问题 I have an API, and I'm trying to make some integration tests for it with XUnit. Here's my API controller constructor: public class MyController : Controller { readonly IMyRepository _myRepository; public MyController(IMyRepository myRepository) { _myRepository = myRepository; } public async Task<IActionResult> GetUser(Guid userId) { try { return Ok(await _my.GetUser(userId)); } catch (Exception ex) { return StatusCode(500, "An error occurred while handling your request."); } } } My API