Answer the question
In order to leave comments, you need to log in
Testing Register method in AccountController Aps.net web api?
I can’t understand how it’s possible to check the Register method through a unit test, I can’t do this
by the default method created by the studio
[AllowAnonymous]
[Route("Register")]
public async Task Register(RegisterBindingModel model)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
ApplicationUser user = new ApplicationUser() { UserName = model.Email, Email = model.Email };
IdentityResult result = await UserManager.CreateAsync(user, model.Password);
if (!result.Succeeded)
{
return GetErrorResult(result);
}
return Ok();
}
Answer the question
In order to leave comments, you need to log in
Hello.
Here they solve a similar problem. You have to fiddle around a lot.
heartdevil I watched it but it didn't help me much, I need something more specific for my
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question