I have an AccountController class, here its ctor:
public AccountController(
UserManager<User> userManager,
SignInManager<User> signInManager,
RoleService roleService,
IConfiguration configuration)
{
_userManager = userManager;
_signInManager = signInManager;
_roleService = roleService;
_configuration = configuration;
}
RoleService it's my own class.
I created a xUnit Test project and use Entity Framework Core to avoid mocking and faking database. I use UseInMemoryData method:
var options = new DbContextOptionsBuilder<ApplicationDbContext>()
.UseInMemoryDatabase(Guid.NewGuid().ToString())
.Options;
var context = new ApplicationDbContext(options);
But i do not understand how can i test AccountController, witch injects UserManager<User>, SignInManager<User>
and so on. How can i create instance of AccountController class?
AccountController
alltogether including database access and http request pipeline?